Skip to content

Instantly share code, notes, and snippets.

View ayust's full-sized avatar

Amber Yust ayust

  • Google
  • Vancouver, BC
  • 07:30 (UTC -07:00)
View GitHub Profile
>>> def echo(s):
... print s
...
>>> funcs = []
>>> for i in range(3):
... funcs.append(lambda: echo(i))
...
>>> for func in funcs:
... func()
...
@ayust
ayust / tomltojson.py
Created January 21, 2017 18:16
Quick script to convert TOML front matter to JSON front matter
#!/usr/bin/env python
import json
import os
JSON_CONFIG = {
"indent": 2,
"sort_keys": True,
"ensure_ascii": False,
"allow_nan": False,