This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/x86 4.0.0-rc5 Kernel Configuration | |
# | |
CONFIG_64BIT=y | |
CONFIG_X86_64=y | |
CONFIG_X86=y | |
CONFIG_INSTRUCTION_DECODER=y | |
CONFIG_PERF_EVENTS_INTEL_UNCORE=y | |
CONFIG_OUTPUT_FORMAT="elf64-x86-64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pysolr | |
def monkeypatch_pysolr(handler='edismax', solr=None): | |
if solr is None: | |
solr = pysolr.Solr('http://localhost:8080/solr') | |
def better_select(params): | |
self = solr | |
params['wt'] = 'json' | |
params_encoded = pysolr.safe_urlencode(params, True) | |
if len(params_encoded) < 1024: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apxs is hardcoded to only compile *.c files so C++ files must be named foo.c or symlinked to foo.c -- What a pain in the ass. | |
OS=$(shell if grep -q Ubuntu /etc/*release; then echo Ubuntu; fi) | |
ifeq ($(OS), Ubuntu) | |
BUILD_BASE=/usr/share/apache2 | |
TOPDIR=$(BUILD_BASE) | |
APXS=apxs2 | |
else | |
BUILD_BASE=/usr/lib/httpd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# found this from Armin R. on Twitter, what a beautiful gem ;) | |
import ctypes | |
from types import DictProxyType, MethodType | |
# figure out side of _Py_ssize_t | |
if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'): | |
_Py_ssize_t = ctypes.c_int64 | |
else: | |
_Py_ssize_t = ctypes.c_int |