Skip to content

Instantly share code, notes, and snippets.

View saebyn's full-sized avatar

saebyn saebyn

View GitHub Profile
@saebyn
saebyn / gist:970647
Created May 13, 2011 14:40
Django tagging example
{% tag_cloud_for_model fanfic.Story as tag_cloud %}
{% for tag in tag_cloud %}
<li><a class="tag-{{ tag.font_size }}" href="{% url story_tag_detail tag %}">{{ tag }} {{ tag.count }}</a></li>
{% endfor %}
@saebyn
saebyn / gist:970652
Created May 13, 2011 14:42
Django taggit example
{% get_tagcloud as tag_cloud for 'fanfic.Story' %}
{% for tag in tag_cloud %}
<li><a class="tag-{{ tag.weight|floatformat:0 }}" href="{% url story_tag_detail tag %}">{{ tag }} ({{ tag.num_times }})</a></li>
{% endfor %}
@saebyn
saebyn / velocity.py
Last active September 27, 2015 00:58 — forked from 9130/velocity.py
Muzzle velocity calculator
# Some old code that I was helping someone with.
GRAINS_PER_POUND = 7000.0
POUNDS_PER_SLUG = 32.175
print "Bullet weight in grains?"
weight = float(raw_input()) / GRAINS_PER_POUND
print "Muzzle velocity in FPS"
velocity = float(raw_input())
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"7b177dd4-91c8-47b2-927a-ef2a82f51304": {
"size": {
"width": 60,
"height": 60
},
"position": {