Skip to content

Instantly share code, notes, and snippets.

View gotche's full-sized avatar

Jose A. Martin gotche

  • Berlin, Germany
View GitHub Profile
Traceback (most recent call last):
File "/home/gotche/.pyenv/versions/autocomp3.8.0rc1/bin/pytest", line 10, in <module>
sys.exit(main())
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/_pytest/config/__init__.py", line 60, in main
config = _prepareconfig(args, plugins)
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/_pytest/config/__init__.py", line 203, in _prepareconfig
return pluginmanager.hook.pytest_cmdline_parse(
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/home/gotche/.pyenv/versions/3.8.0rc1/envs/autocomp3.8.0rc1/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
@gotche
gotche / gist:a3905ad36c4853ee6397
Last active October 29, 2015 18:47
pyinotify example
"""
Example of use of inotify. Extracted from django.utils.autoreload
"""
import pyinotify
def inotify_logs_changed():
class EventHandler(pyinotify.ProcessEvent):
def process_default(self, event):
@gotche
gotche / gist:9729551
Last active August 29, 2015 13:57
ifconfig.me implemented in nginx
location / {
content_by_lua "ngx.say(ngx.var.remote_addr)";
}
# to build nginx you have to install lua and grab the modules
# libluajit-5.1-dev
# ./configure --prefix=/opt/nginx --add-module=/builds/ngx_devel_kit-0.2.19 --add-module=/builds/lua-nginx-module-0.9.6
# just follow the installation instructionshttp://wiki.nginx.org/HttpLuaModule#Installation
@gotche
gotche / mockredis
Created October 8, 2013 17:57
proof of concept for mockredis
class RedisConcept():
def __init__(self):
self.host = "localhost"
self.port = "6379"
self.db = "1"
self.r = redis.Redis(host=self.host, port=self.port, db=self.db)
def get_key(self, key):
return self.r.get(key)