Skip to content

Instantly share code, notes, and snippets.

View andymboyle's full-sized avatar

Andy Boyle andymboyle

View GitHub Profile
@andymboyle
andymboyle / gist:799162
Created January 27, 2011 20:16
Attempted VCL file for Varnish
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "50.16.96.248";
.port = "80";
}
@andymboyle
andymboyle / gist:858896
Created March 7, 2011 18:02
view.py for class
@cache_control(public=True, max_age=300)
def recruiting_year(request, yslug):
year = RecruitClass.objects.get(year_slug=yslug)
recruiting_year = 1
years = RecruitClass.objects.all().order_by('year')
player = Recruit.objects.filter(college_class__year_slug=yslug).filter(Q(signing_day_pick_school__school__short_name="Florida")|Q(verbal_commit_pick_school__school__short_name="Florida")).filter(Q(committed_status__status="Signed")|Q(committed_status__status="Verbal")).order_by('last_name')
return render_to_response('year_detail.html', {
'player': player,
'year': year,
'years': years,
Installing ri documentation for rails-3.0.5...
File not found: lib
ERROR: While generating documentation for rails-3.0.5
... MESSAGE: exit
... RDOC args: --ri --op /Library/Ruby/Gems/1.8/doc/rails-3.0.5/ri lib --title rails-3.0.5 Documentation --quiet
@andymboyle
andymboyle / FireTracker settings.py
Created March 23, 2011 01:56
Here's your FireTracker settings.py file
# Django settings for firetracker project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Your Name', 'yourname@email.com'),
)
MANAGERS = ADMINS
table:
title: University of Nebraska system's 2008 Fiscal Year Salaries
file: unl2008.csv
deck:
<p>Check out how much goddamn money they made </p>
footer:
<p>Source:&nbsp;<a href="http://www.fdic.gov/bank/individual/failed/banklist.html">FDIC</a></p>
column_options:
columns:
- Name
table:
title: University of Nebraska system's 2008 Fiscal Year Salaries
file: unl2008.csv
deck:
<p>Check out how much goddamn money they made </p>
footer:
<p>Source:&nbsp;<a href="http://www.fdic.gov/bank/individual/failed/banklist.html">FDIC</a></p>
column_options:
columns:
- Name
@andymboyle
andymboyle / gist:947608
Created April 29, 2011 00:03
Varnish default.vcl file
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "50.16.96.248";
.port = "8000";
}
user www-data;
worker_processes 1;
error_log /opt/log/nginx.log;
pid /opt/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
@andymboyle
andymboyle / urls.py
Created May 9, 2011 02:07
Firetracker urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^firetracker/$', 'firetracker.fires.views.index'),
(r'^firetracker/fire/(?P<un_id>[-\w]+)/(?P<address>[-\w]+)/$', 'firetracker.fires.views.fire'),
(r'^firetracker/person/(?P<un_id>[-\w]+)/(?P<slug>[-\w]+)/$', 'firetracker.fires.views.person'),
(r'^firetracker/admin/', include(admin.site.urls)),
@andymboyle
andymboyle / fire_detail.html
Created May 9, 2011 02:15
The fire_detail template
<h2><a href="/firetracker/">Return to home</a></h2>
<p><strong>Date:</strong> {{ fire.date.date }}</p>
<p><strong>Street:</strong> {{ fire.location.street }}</p>
<p><strong>City:</strong> {{ fire.location.city.name }}, {{ fire.location.city.state.short_name }}</p>
<p><strong>Responding:</strong> {% if fire.respondings %}{% for r in fire.respondings.all %}{{ r.department.name }}'s {{ r.name }}{% endfor %}{% else %}Not available{% endif %} </p>
<p><strong>Fire reported:</strong> {% if fire.date.time %}{{ fire.date.time }}{% else %}Not available{% endif %}</p>
{% if fire.response_time %}<p><strong>Response time:</strong> {{ fire.time_took }}</p>{% endif %}
{% if fire.extinguish_time %}<p><strong>Extinguish time:</strong> {{ fire.extinguish_time_took }}</p>{% endif %}
<p><strong>Property value:</strong> {% if fire.location.property_value %}${{ fire.location.property_value }}{% else %}Not available{% endif %}</p>
<p><strong>Property damage:</strong> {% if fire.monetary_damage %}${{ fire.monetary_damage }}{% else %