Skip to content

Instantly share code, notes, and snippets.

View neoshrew's full-sized avatar

Andy Gelnar neoshrew

  • London, UK
View GitHub Profile
@neoshrew
neoshrew / results.sh
Created November 13, 2018 12:47
Perf examples for ymanb
$echo; for test in defaultdict setdefault check_in; do echo -n "${test} "; python3 -m timeit -s "from test import test_${test} as test_func" "test_func()"; done
defaultdict 1000 loops, best of 3: 999 usec per loop
setdefault 1000 loops, best of 3: 1.89 msec per loop
check_in 1000 loops, best of 3: 1.27 msec per loop
@neoshrew
neoshrew / nginx-wtf.conf
Last active March 12, 2019 12:30
nginx-wtf
server {
listen 80 default_server;
location = /banana/ {
return 200 'this is a banana.\n';
}
location / {
return 200 'not proxied.\n';
}
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Deny",
"NotPrincipal": {
"AWS": [
"arn:aws:iam::99999999999:role/AppRole",
"arn:aws:iam::99999999999:role/AdminRole"