Skip to content

Instantly share code, notes, and snippets.

@fotcorn
fotcorn / add_block_comment.py
Last active August 2, 2016 11:48
Add a HTML comment on every Django/Jinja2 {% block %} template tag to find out from which file a rendered output is coming from
#!/usr/bin/python3.5
import glob
import re
def replace_generator(fn):
def replace(match):
return '{}\n<!-- file: {} block: {} -->\n'.format(match.group(0), fn, match.group(2))
return replace
use std::collections::hash_map::HashMap;
struct MyStruct {
a: u64,
b: u64,
}
struct Test {
counter: u64,
map: HashMap<u64, MyStruct>,