Skip to content

Instantly share code, notes, and snippets.

View ashwoods's full-sized avatar

Ashley Camba ashwoods

View GitHub Profile
@ashwoods
ashwoods / pre-commit
Created October 11, 2011 17:19
pre-commit hook for VERSION file
#!/bin/sh
# Tag revisions like this:
# $ git tag -a -m "Version 0.2" v0.2 HEAD
VF=VERSION
DEFAULT_VERSION=UNKNOWN
LF='
'
@ashwoods
ashwoods / .gitignore
Created October 11, 2011 17:58
python/django gitignore
*~
*.pyc
*.swp
hospex/local_settings.py
hospex/hospex.db
hospex/site-static/
hospex/compass/.sass-cache/
.code_swarm
.idea
build
node "submitz" inherits default {
include django
include supervisor
django::resource::project {'submitz':
ensure => present,
location => '/opt/submitz/submitz',
source => 'git@github.com:xipax/submitz.git',
user => 'submitz',
Vagrant::Config.run do |config|
config.vm.box = "bribespot-oneiric-v1"
config.vm.box_url = "http://dl.dropbox.com/u/1419385/vagrant/bribespot-oneiric-v1.box"
config.vm.host_name = 'vagrant'
config.vm.network :hostonly, "33.33.33.10"
config.vm.forward_port 8000, 8000 #dev server
config.vm.forward_port 6379, 6379 #redis
config.vm.forward_port 80, 8080 #nginx
@ashwoods
ashwoods / gist:2932860
Created June 14, 2012 20:50
django supervisor example
# This file is autogenerated by Puppet. Manual changes will be overwritten!
[program:gunicorn-bribespot]
command=/opt/bribespot/.virtualenvs/bribespot/bin/gunicorn_django -w 4 -b 0.0.0.0:9000
numprocs=1
priority=999
autostart=true
autorestart=true
startsecs=1
startretries=3
exitcodes=0,2
@ashwoods
ashwoods / bribespot.conf
Created June 14, 2012 20:55
nginx configuration
server {
listen *;
server_name bribespot.org;
access_log /var/log/nginx/bribespot.access.log;
location / {
proxy_pass http://bribespot_app;
proxy_read_timeout 120;
}
@ashwoods
ashwoods / base.html
Created June 18, 2012 17:17
base.html
<html>
<header></header>
<body>
{% block content %}{% endblock %}
</body>
</html>
<html>
<body>
{% block content %}
I am the parent, and any template extending me and has a block content will replace this sentence.
{% endblock %}
</body>
</html>
import re
from django.utils.cache import patch_vary_headers
from django import http
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils import translation
@ashwoods
ashwoods / gist:4510319
Created January 11, 2013 12:28
calculating md5 from file.api
<html>
<head>
<title>HTML5 File example</title>
<STYLE TYPE="text/css">
<!--
TD{font-family: Arial, Helvetica, sans-serif; font-size: 8pt;}
--->
</STYLE>
<style>.example{padding:10px;border:1px solid #ccc}#drop_zone{border:2px dashed #bbb;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;padding:25px;text-align:center;font:20pt bold,"Vollkorn";color:#bbb}.thumb{height:75px;border:1px solid #000;margin:10px 5px 0 0}#progress_bar{margin:10px 0;padding:3px;border:1px solid #000;font-size:14px;clear:both;opacity:0;-o-transition:opacity 1s linear;-moz-transition:opacity 1s linear;-webkit-transition:opacity 1s linear;-ms-transition:opacity 1s linear}#progress_bar.loading{opacity:1}#progress_bar .percent{background-color:#9cf;height:auto;width:0}#byte_content{margin:5px 0;max-height:100px;overflow-y:auto;overflow-x:hidden}#byte_range{margin-top:5px}</style>