Skip to content

Instantly share code, notes, and snippets.

Avatar

Jack O'Connor oconnor663

View GitHub Profile
View gist:9aeb4ed56394cb013a20

EDIT from 2019: Hi folks. I wrote this gist for myself and some friends, and it seems like it's gotten posted somewhere that's generated some (ahem, heated) discussion. The whitespace was correct when it was posted, and since then GitHub changed how it formats <pre> tags. Look at the raw text if you care about this. I'm sure someone could tell me how to fix it, but (thank you @anzdaddy for suggesting a formatting workaround) honestly this is a random throwaway gist from 2015, and someone more knowledgable about this comparison should just write a proper blog post about it. If you comment here I'll hopefully see it and stick a link to it up here. Cheers. @oconnor663

Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?

title = "TOML Example"
 
View .Naquium Processing
0eNrFvUuPnMnRrPlXBlyLB3G/CINZzKzO5mB2sxAEgd0stQofm+ThRfoEof/7VJFSd6aYb/Ix86rURmoWWWHhHu7xRoRbWPzjxQ9vPt+9/3D/9tOffnj37r9e/P4fv/3k44vf/+Hkj49/d//ju7dff/zx/qe3r948/uzT39/fvfj9i/tPdz+/+N2Lt69+fvzTx7uX7z+/+evdh/uPdx9e/PK7F/dvX9/994vf51/++LsXd28/3X+6v/va0Jc//P1Pbz///MPDv/x9/rWJu/9+/+Hu48eXH9+/uf/06eHvfvfi/buPD7/47u0j7ENjL3Pt7Xcv/v7lv2r+H/0B5/X9h7sfv/6b9svvvmm+fNP8pw+v3n58/+7Dp5c/3L35dADyP/qvMInAVNGKolnRxOar1vsuNp+03o9vmv/8EBwffvrw7uH/r4xCujoKv/s1EN++//zpxQXcaY19Vsd+ad5rS/Pe9rzXdtB7OZnAKwqcnXFrQx23bM0NbV7DKZdwanQOKgvhtDDORn7rZj6Xq0ggMNyJpEaBvZmkyiO4LJwi45hzyunceAHp+44sKf4p+Bb4txF89/nTEXKOfgy+jZxLri3egiPJODX+Wbg2hFc8aU0zp1+FCyN4CadbOFv25Ajbw3Bm9LMG/bainzWIs8M46HNTU9hvDCeHP58D4YS3JGUinBr+aH2DMy7hqJuT08/VBO33sB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/efisn1tW8028W4dL+vyqb3+L5oaPYle21+HSTSbb9er/a6I2/s2ZbWMprt6X0yicrGuTnDbclnNVu17d6+bIppG5a54jiZRNXtur+pZuYoapLJ6Khpwdfh3EhXVrtyVxen9x4vXx2r/PC/q5oYP74zP6JNos94271lXZ5JKPdgjzTh5sIfD5BOOfseZl8u4WBWLXV0u4s16VQho2REraXg2z1U195bHx3uLVPujLp4uqbYnpXz7IMu6KCrppYNEybxT2u6ah1t+28XH0/lMxxzpKAkkhUHyfhBLMjESSEYyEUEcyUT8rD3JRATJSSZOAlEJSUVGUSSXXETRJBcZhbZa0eIUbbcyDGu5SrQ6xdpuDwxrvUq0POW/EKtUhgcrffFP22tje4OXdKsYzFTOHqEcphP2CEWP0YplI8Nolo3oM9qwbGSYlGSjRZ/RlmTTA5OxbESf0Y5lI8N4lo1sfqwVyzCGtWItmp9hrbgHhrViLZqfYa24B4a1YiOan7FfCJLHHPaeGR2dA8nP5rCkVyfnpNfoJumdRE9lfXqwJi1syR8z7+lFgj+JVrN50STn0V9nes2fXop6e3yP9ip1ae4yp5LMZj+S9KTl+LOUCYt9/VI89R37iWT28bCywXphELDVq8+AZky23yVfHxDdmNRfGwlSDRYCg099Tjl0GDADj/EdcbAmuE861Khtr6fnPZ7umYPSybVzDpUbyEFdI9pRtce7sIYxOT/TWdiK8bLkXXGDVndRpCDee01TjypYtBF5ulHlizbiZ2SGixnoM/KBUgY6QQ98KP6jqi2+zcqqv6GTnbVN+2tty4bLj/ukA643RrieEHFRygDP+0PLFavlf+/rCtJx9TPp+GDmY0zX7vtkHWpQzANuZk5uFgO+a1hMF3ZdOMa0lUGLacI
@oconnor663
oconnor663 / test.py
Last active Oct 23, 2020
A demonstration of GIL-releasing hashing leading to a data race in Python
View test.py
#! /usr/bin/env python3
import hashlib
import threading
def hash_buf(buf):
return hashlib.blake2b(buf).hexdigest()
View .Production Blueprints
0eNrcvdtuXEmSLfgrCT0XG9vv7oWDAaZ6cGoeZoBBn6dBo5CgqMh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