Skip to content

Instantly share code, notes, and snippets.

View ayang's full-sized avatar

ayang ayang

View GitHub Profile
@drewr
drewr / script-score.sh
Created October 23, 2013 22:50
Example of function_score using the script_score function. This achieves a result similar to creating a script field and then sorting descending by that dynamic value.
#!/bin/sh
curl -XDELETE localhost:9200/foo >/dev/null
curl -XPOST localhost:9200/foo/t -d'
{
"clicks": 10,
"impressions": 1000,
"when": "2013-10-01"
}
@randvoorhies
randvoorhies / gist:6887471
Last active December 25, 2015 00:19
Patch for Homebrew OpenCV to fix: Undefined symbols for architecture x86_64: "_faacEncClose", referenced from: _Faac_encode_close in libavcodec.a(libfaac.o) _Faac_encode_init in libavcodec.a(libfaac.o) etc...
--- opencv-2.4.6.1/modules/highgui/CMakeLists.txt.orig 2013-10-08 10:16:00.000000000 -0700
+++ opencv-2.4.6.1/modules/highgui/CMakeLists.txt 2013-10-08 10:14:40.000000000 -0700
@@ -191,7 +191,7 @@
list(APPEND HIGHGUI_LIBRARIES ${BZIP2_LIBRARIES})
endif()
if(APPLE)
- list(APPEND HIGHGUI_LIBRARIES "-framework VideoDecodeAcceleration" bz2)
+ list(APPEND HIGHGUI_LIBRARIES "-framework VideoDecodeAcceleration -lmp3lame -lfaac -liconv -lx264 -lxvidcore" bz2)
endif()
endif(HAVE_FFMPEG)
@bylatt
bylatt / optimize-ssd.md
Last active April 4, 2018 20:36 — forked from ummels/os-x-enable-trim.md
Optimize non-Apple SSDs on OS X.

Optimize non-Apple SSDs on OS X. (Run the following commands in the terminal.)

Enable TRIM support

Check IOAHCIBlockStorage version:

open /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/version.plist
# UpYun storage for django, written by Tyr Chen @ tukeq.com
# to run this gist you need to get upyun python sdk first.
# upyun storage
class UpYunStorage(Storage):
def __init__(self, bucket=settings.UPYUN_BUCKET):
self.upyun = UpYun(bucket, settings.UPYUN_USERNAME, settings.UPYUN_PASSWORD)
self.upyun.setApiDomain(settings.UPYUN_API_DOMAIN)
self.binding_domain = settings.UPYUN_BINDING_DOMAIN