Skip to content

Instantly share code, notes, and snippets.

View darrenjs's full-sized avatar

Darren Smith darrenjs

  • London
View GitHub Profile
void main() {
}
@darrenjs
darrenjs / python_redis_example.py
Created September 4, 2018 06:49
example of using redis with python
import redis
import redis.sentinel
import logging
# TODO: would be useful to also
def discover_redis_master(sentinel_addrs, redis_name):
"""Use listed sentinels to find the redis master
"""
sentinel = redis.sentinel.Sentinel(sentinel_addrs, socket_timeout=0.1)
@darrenjs
darrenjs / publish.py
Created August 8, 2018 06:19 — forked from Mdrbhatti/publish.py
Protocol error with wampcc + autobahn python publish
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@darrenjs
darrenjs / ssl_server_nonblock.c
Last active March 22, 2024 08:34
OpenSSL example using memory BIO with non-blocking socket IO
/*
This file had now been added to the git repo
https://github.com/darrenjs/openssl_examples
... which also includes a non blocking client example.
-------------------------------------------------------------------------------
ssl_server_nonblock.c -- Copyright 2017 Darren Smith -- MIT license