I hereby claim:
- I am kenbolton on github.
- I am kenbolton (https://keybase.io/kenbolton) on keybase.
- I have a public key whose fingerprint is F43F 3EA4 4440 2A44 8E43 E7C9 AD7E 8178 CD53 B45A
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
EXTRA_MODEL_FIELDS = ( | |
( | |
"cartridge.shop.models.Product.tic", | |
"CharField", | |
("Taxability Information Code",), | |
{"max_length":"5", "blank": True, "default":"00000", }, | |
), | |
) |
from decimal import Decimal | |
from cartridge.shop.models import Order, SelectedProduct | |
def setup(self, request): | |
""" | |
Set order fields that are stored in the session, item_total, tax_total, | |
and total based on the given cart, and copy the cart items to the order. | |
Called in the final step of the checkout process prior to the payment |
$(function() { | |
// Create filter actions. | |
var checkbox = $('input[name=joins-leaves]') | |
$('label[for=joins-leaves]').toggle( function () { | |
$('.joins, .leaves').css({'display': 'none'}); | |
checkbox.prop('checked', true); | |
}, function () { | |
$(".joins, .leaves").css({'display': 'table-row'}); | |
checkbox.prop('checked', false); | |
}); |
Vagrant::Config.run do |config| | |
config.vm.box = "precise64" | |
config.vm.network :hostonly, "192.168.124.10" | |
end |
@task | |
@log_call | |
def download_media(): | |
media = 'media.tar.gz' | |
run("tar -czvf %s/%s -C %s/static/media/" % (env.proj_path, media, | |
env.proj_path)) | |
get('%s/%s' % (env.proj_path, media), media) | |
@task | |
@log_call |
from django.contrib.auth.models import User | |
from django.db import models | |
from django.db.models.signals import post_save | |
from mezzanine.core.fields import RichTextField | |
from cartridge.shop.models import Product | |
from social_auth.signals import pre_update | |
from social_auth.backends.google import GoogleOAuth2Backend |
#! /usr/bin/env python | |
import redis | |
import random | |
import pylibmc | |
import psycopg2 | |
import sys | |
from time import clock | |
r = redis.Redis(host='localhost', port=6379) |
def main(): | |
list_of_primes = [2] | |
while len(list_of_primes) < 1000: | |
if list_of_primes[-1] % 2 == 0: | |
value = list_of_primes[-1] + 1 | |
else: | |
value += 2 | |
is_prime = True | |
for i in list_of_primes: | |
if i > value * 0.5: |