Skip to content

Instantly share code, notes, and snippets.

'email': {'fields': {'exact': {'index': 'not_analyzed',
'type': 'string'},
'email': {'analyzer': 'default',
'index': 'analyzed',
'type': 'string'}},
'type': 'multi_field'}
---
query_string: "test" doesn't find the document with email "test@email.com"
@yedi
yedi / handler.clj
Last active December 24, 2015 11:29
How would I get lein uberjar to return a jar that has the manifest file?
(ns skateproj.handler
(:use compojure.core
sandbar.stateful-session)
(:require [clojure.string :as str]
[skateproj.db :as db]
[compojure.handler :as handler]
[compojure.route :as route]
[skateproj.routes :as r]
[ring.adapter.jetty :refer [run-jetty]])
:gen-class)
@yedi
yedi / gist:6790530
Last active December 24, 2015 11:19
---
- hosts: local
sudo: true
vars:
system_packages:
- git
- openjdk-7-jre-headless
- wget
- unzip
- vim
@yedi
yedi / gist:6789630
Last active December 24, 2015 11:18
bash-3.2$ ssh vagrant@192.168.111.222
vagrant@192.168.111.222's password:
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 06:22:31 2012 from 10.0.2.2
vagrant@precise32:~$ exit
logout
Connection to 192.168.111.222 closed.
(commcare-hq)Yedis-MacBook-Pro:commcare-hq yedianyansi$ git branch -D staging
Deleted branch staging (was 18b3ad6).
(commcare-hq)Yedis-MacBook-Pro:commcare-hq yedianyansi$ gco staging origin/staging
error: pathspec 'staging' did not match any file(s) known to git.
error: pathspec 'origin/staging' did not match any file(s) known to git.
(commcare-hq)Yedis-MacBook-Pro:commcare-hq yedianyansi$ gcob staging origin/staging
M submodules/auditcare-src
M submodules/casexml-src
M submodules/commcare-translations
M submodules/couchexport-src
if check(x):
do(this)
if check(x) || check(y):
do(that)
@yedi
yedi / gist:6010411
Created July 16, 2013 16:46
Bug when trying to run heapy (Anyone know of better memory profiling tools)
(commcare-hq)Yedis-MacBook-Pro:commcare-hq yedianyansi$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from guppy import hpy
>>> h = hpy()
Error at initialization of module heapycTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/yedianyansi/.virtualenvs/commcare-hq/lib/python2.7/site-packages/guppy/__init__.py", line 37, in hpy
return r.guppy.heapy.Use
@yedi
yedi / gist:5574830
Last active December 17, 2015 07:39
$('#generic_select_box-f247acff18f2 option')
[<option value="_all">All Mobile Workers & Others</option>,<option value="ef158bb5fe49079aa6a881be13aca18b">lj "L J"</option>]
$('#generic_select_box-f247acff18f2 option[value="_all"')
[]
>>> def fn():
... v = False
... def nfn():
... v = True
... print v
... nfn()
... print v
...
>>> fn()
False
{
"query": {
"bool": {
"must": [
{
"in": {
"domain.exact": [
"mvp-potou"
]
}