Skip to content

Instantly share code, notes, and snippets.

@agounaris
agounaris / .tmux.conf
Last active August 29, 2015 14:15
tmux configuration
set -g status on
set -g status-keys vi
set -g history-limit 1000000
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Set prefix to Ctrl-Space
unbind C-b
@agounaris
agounaris / es_score_matching.json
Last active August 29, 2015 14:14
Elasticsearch score matching
{
"from": 0,
"query": {
"function_score": {
"functions": [
{
"weight": 1.5,
"filter": {
"term": {
"_type": "store"
@agounaris
agounaris / jquery_dropdown_autocomplete_ajax.js
Last active August 29, 2015 14:13
an ajax request to populate suggestions on a search field, elasticsearch content
$(function() {
var ajaxLoading = false;
$( "#search" ).keypress(function() {
var postData = {
"suggest" : {
"text" : $("#search").val(),
"completion" : {
"field" : "suggest"