This file contains hidden or 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
<table class="boxWrap" data-module="section_01" data-thumb="http://www.stampready.net/dashboard/zip_uploads/0v4AtMP76HRioNJDzCLhmpFr/Essentials_InlineCSS_SR_MC_CM/thumbnails/section_01.jpg" align="center" border="0" cellpadding="0" cellspacing="0" width="100%"> | |
<tbody><tr mc:repeatable=""> | |
<td style="background-color: rgb(33, 149, 189);" data-bgcolor="backgroundcolor05" bgcolor="#71beba"> | |
<div> | |
<table class="mobileBoxWrap" align="center" border="0" cellpadding="0" cellspacing="0" width="1025"> | |
<tbody><tr> | |
<td width="100%"> | |
<table class="boxWrap" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" align="center" border="0" cellpadding="0" cellspacing="0" width="1025"> | |
<tbody><tr><td height="25" width="100%"><br></td></tr> | |
</tbody></table> |
This file contains hidden or 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
department_map = {} | |
reader = csvreaderitems | |
def get_or_create_department(department_id): | |
department = department_map.get(department_id, None) | |
if department is None: | |
department = Department.create(id=department_id) | |
department_map[department_id] = department | |
return department |
This file contains hidden or 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 json | |
import HttpResponse | |
def _json_response(context): | |
return HttpResponse(json.dumps(context), mimetype="application/json") | |
def view(request): | |
context = {} | |
# do stuff to context | |
if request.is_ajax(): |
This file contains hidden or 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
# URL in urls.py | |
url(r'blog/(?P<post_id>[\d]+)/$', 'blog_post', name='blog_post'), | |
# VIEW in views.py | |
def blog_post(request, post_id): | |
post=BlogPost.objects.get(id=blog_id) | |
return render(request, 'blog_post.html', { |
This file contains hidden or 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 | |
import os | |
import sys | |
import getopt | |
import datetime | |
import csv | |
class RobLog(object): | |
input_file = None |
This file contains hidden or 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
def reverse_string(string): | |
new_string = [] | |
for i in range(len(string)): | |
new_string.append(string[-(i+1)]) | |
new_string = ''.join(new_string) | |
return new_string |
This file contains hidden or 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
for coord in a: | |
xy1, xy2 = coord | |
if xy1 == spot[0] or xy1 == spot[1] or xy2 == spot[0] or xy2 == spot[1]: | |
a.pop(a.index(coord) |
This file contains hidden or 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
# Example recursive | |
import random | |
def recursive_check(loop=1): | |
""" This is a very basic recursive example. | |
Each recursive loop grabs a random number between 1 and 10 and checks to see if its 7. | |
The loop will record how many attemps it takes and return the number when the random integer is 7. | |
""" | |
random_int = random.randrange(10) |
This file contains hidden or 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
class Movie(models.Model): | |
title = models.CharField(max_length=500) | |
description = models.CharField(max_length=500, blank=True, default=u"") | |
category = models.CharField(max_length=200, choices=MOVIE_CATEGORIES) | |
aff_url = models.URLField(blank=True, default=u"", max_length=1000) | |
trailer_url = models.URLField(blank=True, default=u"") | |
starring = models.ManyToManyField("pois.Poi", blank=True) | |
price = models.IntegerField(blank=True, default=0) | |
image = models.ImageField(upload_to=partial(get_upload_location, "movie")) | |
releasedate = models.DateField(null=True,blank=True) |
This file contains hidden or 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
class Board(object): | |
""" This is the base board object | |
The initialize function can be sent a board_size attribute which defaults | |
to 5x5 | |
""" | |
board = [] | |
board_size = None | |
tile_character = '0' |
NewerOlder