Skip to content

Instantly share code, notes, and snippets.

View chaudum's full-sized avatar
🏠
Working from home

Christian Haudum chaudum

🏠
Working from home
View GitHub Profile
@chaudum
chaudum / gist:7a0a70456e7ea90822fe8e2c1396d4e1
Created October 11, 2016 15:27
Elasticsearch fails to sort date field
>>> http :9200
HTTP/1.1 200 OK
Content-Length: 368
Content-Type: application/json; charset=UTF-8
{
"cluster_name": "elasticsearch",
"cluster_uuid": "xhTZ616DRM6_phplNiRHRw",
"name": "Hamilton Slade",
"tagline": "You Know, for Search",
DROP TABLE IF EXISTS table_x;
CREATE TABLE table_x (
"name" STRING,
INDEX "name_ft" USING FULLTEXT ("name") WITH (analyzer='standard')
) WITH (
number_of_replicas='0'
);
INSERT INTO table_x (name) VALUES ('aaa'), ('bbb'), ('ccc'), ('aaa bbb'), ('bbb ccc'), ('aaa ccc');
REFRESH TABLE table_x;
SELECT *, _score FROM table_x WHERE match((name_ft), 'aaa bbb') USING best_fields WITH (minimum_should_match=1) order by _score desc;
@chaudum
chaudum / tmp.6yIaVb7J
Last active September 29, 2016 16:11
cr> select version_info['hash'], date_format(version_info['date']), statement, runtime_stats['median'], runtime_stats['stdev'] from benchmarks order by 1, 3 limit 100;
+------------------------------------------+-----------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------+------------------------+
| version_info['hash'] | date_format(version_info['date']) | statement | runtime_stats['median'] | runtime_stats['stdev'] |
+------------------------------------------+-----------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------+------------------------+
| 2b26ad27bd762b64363ca990d9a81fa42f6c3cc5 | 2016-09-29T00:00:00.000000Z | SELECT col_a, col_b FROM t_null_columns WHERE NOT
@chaudum
chaudum / test.sh
Created September 21, 2016 13:13
dirname "${BASH_SOURCE[0]}"
" ~/.vimrc
" vim configuration for terminal
filetype off
execute pathogen#infect()
execute pathogen#helptags()
syntax on
color hybrid

Planning

PostgreSQL JDBC in sample app

Work packages:

  • instructions how to build postgres jdbc see sql/build.gradle in crate/crate repo
    • talk to Marios/Basti first
  • remove crate jdbc dependency from project
apply plugin: "java"
repositories {
jcenter()
}
dependencies {
compile('com.microsoft.azure:azure-mgmt-utility:0.9.3') {
exclude group: 'stax', module: 'stax-api'
exclude group: 'org.slf4j', module: 'slf4j-api'
{
"STATUSBAR": {
"CLUSTER": "Cluster",
"VERSION": "Version",
"SNAPSHOT": "SNAPSHOT",
"NODES": "Knoten",
"HEALTH": "Status",
"DATA": "Daten",
"CHECKS": "Checks",
"HELP": "Hilfe",
#!/bin/bash -e
# Script to launch and provision a VM on Azure for creating an Azure VM Image.
# Requires the Azure CLI tool to be installed!
#
# Usage:
# This script requires 3 parameters:
# - $1 the path to the public key that should be used for VM creation
# - $2 the version of the Crate Ubuntu package that should be installed on the VM image
# - $3 the revision of the Crate Ubuntu package
@chaudum
chaudum / key-bindings.zsh
Last active November 24, 2017 18:26
Key Bindings for fzy+zsh
# Key bindings for fzy
# https://github.com/jhawthorn/fzy
#
# Installation:
# Place this file e.g. in ~/.fzy/ and add "source ~/.fzy/key-bindings.zsh" to your .zshrc
if [[ $- == *i* ]]; then
__fzycmd() {