Skip to content

Instantly share code, notes, and snippets.

View test.rs
use std::collections::hash_map::HashMap;
struct MyStruct {
a: u64,
b: u64,
}
struct Test {
counter: u64,
map: HashMap<u64, MyStruct>,
@fotcorn
fotcorn / add_block_comment.py
Last active Aug 2, 2016
Add a HTML comment on every Django/Jinja2 {% block %} template tag to find out from which file a rendered output is coming from
View add_block_comment.py
#!/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