This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
register = template.Library() | |
OFFSET = ord('🇦') - ord('A') | |
@register.filter | |
def flag(code): | |
return chr(ord(code[0]) + OFFSET) + chr(ord(code[1]) + OFFSET) | |
# Example: | |
# flag("US") = "🇺🇸" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A simple program to show how to grab statistics from OpenBSD's pf using C. | |
gcc pf_to_web.c | |
sudo ./pf_to_web | |
Aaron Linville | |
http://www.linville.org/ | |
*/ |