Skip to content

Instantly share code, notes, and snippets.

@blopker
blopker / -README.MD
Last active July 19, 2020 21:14
Disable semantic interposition?

Python disable semantic interposition benchmark

This is a test of the official Python Docker containers, with and without the --with-lto config flag and the -fno-semantic-interposition compiler flag. These flags enable faster function lookup accrding to https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup

Files

runner.sh: Builds then runs the containers with by invoking test.sh

@blopker
blopker / __README.md
Last active December 2, 2018 18:10
Python PGO Benchmarks

Python PGO Benchmark

This is a test of the official Python Docker containers, with and without the --enable-optimizations flag. This flag turns on PGO.

Files

build.sh

This file us run inside the modified https://github.com/docker-library/python repo. It builds and tags all the optimized images.

test.sh

@blopker
blopker / language_redirect_middleware.py
Created August 3, 2016 02:33
Get redirecting like django-solid-i18n-urls but in Django 1.10.
from django.conf import settings
from django.utils import translation
from django.conf.urls.i18n import is_language_prefix_patterns_used
from django.shortcuts import redirect
from django.urls import translate_url
class LanguageRedirectMiddleware():
""" Redirect if user goes to default language and is not set to default language
Also redirect user to bare url if default prefix is in url. """

Keybase proof

I hereby claim:

  • I am blopker on github.
  • I am blopker (https://keybase.io/blopker) on keybase.
  • I have a public key whose fingerprint is 5BB4 D316 FF0C 08CC BD60 4E0F B97F B9D3 113B C51F

To claim this, I am signing this object:

@blopker
blopker / gist:341aad62241f3637bd8d
Last active August 29, 2015 14:02
Django Creek API
from django.views.generic import View
from django.http import HttpResponse
from django_creek import FlowState, FlowController, flowState
class ViewOne(FlowState, View): # Supports CBVs, just mix in a standard Django View or View subclass
flow_name = 'one'
def get(self, request):
return self.render({})