Skip to content

Instantly share code, notes, and snippets.

View tjcunliffe's full-sized avatar

Tom Cunliffe tjcunliffe

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tjcunliffe on github.
  • I am tjcunliffe (https://keybase.io/tjcunliffe) on keybase.
  • I have a public key ASBKBfcXN0rYBGRN84jxNVKEmrfOJTKmE96yx5LGles6Ugo

To claim this, I am signing this object:

{
"data": {
"pairs": [
{
"response": {
"status": 200,
"body": "{\"a\": \"b\"}\n",
"encodedBody": false,
"headers": {
"Access-Control-Allow-Origin": [
{"data":[{"response":{"status":404,"body":"\n\n\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\n\u003chead\u003e\n\n \u003c!-- meta --\u003e\n \u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"\u003e\u003cscript type=\"text/javascript\"\u003ewindow.NREUM||(NREUM={}),__nr_require=function(e,t,n){function r(n){if(!t[n]){var o=t[n]={exports:{}};e[n][0].call(o.exports,function(t){var o=e[n][1][t];return r(o||t)},o,o.exports)}return t[n].exports}if(\"function\"==typeof __nr_require)return __nr_require;for(var o=0;o\u003cn.length;o++)r(n[o]);return r}({1:[function(e,t,n){function r(e,t){return function(){o(e,[(new Date).getTime()].concat(a(arguments)),null,t)}}var o=e(\"handle\"),i=e(2),a=e(3);\"undefined\"==typeof window.newrelic\u0026\u0026(newrelic=NREUM);var u=[\"setPageViewName\",\"addPageAction\",\"setCustomAttribute\",\"finished\",\"addToTrace\",\"inlineHit\"],c=[\"addPageAction\"],f=\"api-\";i(u,function(e,t){newrelic[t]=r(f+t,\"api\")}),i(c,function(e,t){newrelic[t]=r(f+t)}),t.ex
#!/usr/bin/env python
import sys
import logging
import random
from time import sleep
logging.basicConfig(filename='random_delay_middleware_python.log', level=logging.DEBUG)
logging.debug('Random delay middleware is called')
# set delay to random value less than one second