This file contains 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
{% block scripts %} | |
<script type="text/javascript" charset="utf-8"> | |
$(function(){ | |
$('#submit').click(function(){ | |
var username = $("input#id_username").val(); | |
var password = $("input#id_password").val(); | |
$form = $('#login_form'); | |
$form.find('.errorlist').remove(); | |
errordata = '<ul class="errorlist"><li>There was a server error processing your login. Please try again.</li></ul>' | |
$.ajax({ |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Don't allow users to view robots.txt file | |
# RewriteCond %{REQUEST_URI} !^/robots\.txt$ | |
# Force add 'www' to URIs without 'www' (permanent redirect) | |
# RewriteCond %{HTTP_HOST} ^yourdomainname\.com$ [NC] | |
# RewriteRule ^(.*)$ http://www.yourdomainname.com/$1 [L,R=301] |
This file contains 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
# man apachectl | |
sudo apachectl start | |
sudo apachectl stop | |
sudo apachectl restart | |
sudo apachectl configtest |
This file contains 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
#!/bin/sh | |
# You must have your virtualenv activated to run this script | |
NAME=gunicorn_timothyfletcher | |
PID=/home/fire/www/timothyfletcher.com/conf/gunicorn.pid | |
SETTINGS=/home/fire/www/timothyfletcher.com/timothyfletcher/settings.py | |
LOGFILE=/home/fire/www/timothyfletcher.com/logs/gunicorn.log | |
WORKERS=12 | |
BIND_ADDRESS=127.0.0.1:8000 |
This file contains 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
{% if is_paginated %} | |
<div class="pagination"> | |
{% for p in paginator.page_range %} | |
{% if forloop.first %}{% if page_obj.has_previous %}<a href ="?page={{ page_obj.previous_page_number }}" id="previous">« previous</a>{% endif %}{% endif %} | |
<span{% ifequal page_obj.number p %} class="current"{% endifequal %}><a href="?page={{ p }}" >{{ p }}</a></span> | |
{% if forloop.last %}{% if page_obj.has_next %}<a href ="?page={{ page_obj.next_page_number }}" id="next">next »</a>{% endif %}{% endif %} | |
{% endfor %} | |
</div> | |
{% endif %} |
This file contains 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
#!/bin/sh | |
# You must have your virtualenv activated to run this script | |
NAME=gunicorn_timothyfletcher | |
PID=/home/fire/www/timothyfletcher.com/conf/gunicorn.pid | |
SETTINGS=/home/fire/www/timothyfletcher.com/timothyfletcher/settings.py | |
LOGFILE=/home/fire/www/timothyfletcher.com/logs/gunicorn.log | |
WORKERS=8 | |
BIND_ADDRESS=127.0.0.1:8000 |
This file contains 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
import re | |
from django.db.models import Q | |
from django.shortcuts import render_to_response | |
from django.template import RequestContext | |
from apps.missions.models import Mission | |
from apps.profiles.models import Profile | |
def normalize_query(query_string, |
This file contains 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
#!/bin/sh | |
# http://nathanvangheem.com/news/gunicorn-startup-script-for-django | |
# Place the script in the file - /etc/init.d/gunicorn or whatever you'd like to call it | |
# make it executable - chmod +x /etc/init.d/gunicorn | |
# And finally, wire it up - update-rc.d gunicorn defaults | |
ADDRESS='127.0.0.1' | |
PYTHON="/opt/django/bin/python" | |
GUNICORN="/opt/django/bin/gunicorn_django" |
This file contains 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
Timothys-MacBook-Air:~ tim$ brew install macvim | |
==> Downloading https://github.com/b4winckler/macvim/tarball/snapshot-63 | |
######################################################################## 100.0% | |
==> ./configure --with-features=huge --with-tlib=ncurses --enable-multibyte --with-macarchs=x86_64 --enable-perlinter | |
==> make | |
==> Caveats | |
MacVim.app installed to: | |
/usr/local/Cellar/macvim/7.3-63 | |
To link the application to a normal Mac OS X location: |
This file contains 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
# Install rails 'globally' for a ruby version | |
RBENV_VERSION=1.9.2-p290 rbenv exec gem install rails | |
# We're installing gems into vendor/bundle so don't run bundler when creating a new rails project | |
RBENV_VERSION=1.9.2-p290 rbenv exec rails new my_project --skip-bundle | |
# Install gems | |
cd my_project | |
rbenv local 1.9.2-p290 | |
bundle install --path vendor/bundle |
OlderNewer