Skip to content

Instantly share code, notes, and snippets.

View holmesconan's full-sized avatar

Holmes Conan holmesconan

  • Hebei, China
View GitHub Profile
#!/bin/bash
action=$1; uri=$2; shift; shift;
case "$action" in
GET)
curl -XGET "localhost:9200/$uri?pretty=1" "$@"
;;
PUT)
curl -XPUT "localhost:9200/$uri?pretty=1" "$@"
;;
@holmesconan
holmesconan / capture.cpp
Created August 28, 2015 12:44
Capture screen by GDI on Windows
HDC hdc = GetDC(NULL); // get the desktop device context
HDC hDest = CreateCompatibleDC(hdc); // create a device context to use yourself
// get the height and width of the screen
int height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
int width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
// create a bitmap
HBITMAP hbDesktop = CreateCompatibleBitmap( hdc, width, height);