Skip to content

Instantly share code, notes, and snippets.

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.

title = "TOML Example"
 
@oconnor663
oconnor663 / squawker.cpp
Last active Jul 16, 2021
C++ constructor/destructor squawker
View squawker.cpp
#include <iostream>
#include <string>
using namespace std;
class Squawker {
public:
Squawker(string name) : name(name) {
cout << "constructor " << name << "\n";
}
@oconnor663
oconnor663 / bad_git.sh
Created Oct 4, 2017
edit a git commit without changing the hash
View bad_git.sh
#! /bin/bash
d="$(mktemp -d)"
# Make a git repo with one file in it.
mkdir "$d/good"
cd "$d/good"
git init
echo good > file.txt
git add -A
@oconnor663
oconnor663 / test.py
Last active Jun 5, 2021
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 .Space Blueprints
0eNrsvWtvZDmSJfhXCvFxVuq9fJOJngZ2B5hPs8CgtrDAohEIKBQekb6lkNQuKbuzG/nf19318Cv3ey7PsavISvXUh1RmulyHZkYjaS8a/+PD56uH1e1mfX3/6fPNzV8//PQfh0/uPvz0z6P/3f1ufXlz/fjx3frb9cXV7rP7X29XH376sL5fff9w9uH64vvu/64fLq9WF5vzzeri8v5m8+G3sw/r6y+rf/vwk/vtbMFf+98+nn1YXd+v79erR0L2//Prp+uH759Xmy38C8jdw+e7+4v79c31Fvj25m69/8/tkDsihnj24dcPP53HuMW+Xq2//fz55mGzQ3RD+rgj8QjXH3DvVxffz+8fNp/X16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