Skip to content

Instantly share code, notes, and snippets.

View utkarshmalik211's full-sized avatar
🎯
Focusing

Utkarsh Malik utkarshmalik211

🎯
Focusing
View GitHub Profile
@utkarshmalik211
utkarshmalik211 / elasticScroll.py
Last active April 1, 2019 09:36
Minimal Python ElasticSearch scroll example WITHOUT client library
data = []
base_url="https://<elasticsearch-cluster-name>.us-west-2.es.amazonaws.com/"
payload = {
"size":10000,
"query":{
"match_all": {}
}
}
response = requests.post(base_url+"<index-name>/_search?scroll=1m", json=payload)
response = json.loads(response.content.decode())
@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active June 3, 2024 06:00
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@nikotan
nikotan / main.cpp
Created August 16, 2011 11:49
face detection sample code for OpenCV
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv/ml.h>
void doMosaic(IplImage* in, int x, int y,
int width, int height, int size);
int main (int argc, char **argv)
{
int i, c;