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
# Standard Python imports. | |
import os | |
import sys | |
import logging | |
import __builtin__ | |
# Google App Hosting imports. | |
from google.appengine.ext.webapp import util |
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
# Django settings for graphcoloring project. | |
import os | |
DEBUG = True | |
TEMPLATE_DEBUG = DEBUG | |
ADMINS = ( | |
# ('Your Name', '[email protected]'), | |
) | |
MANAGERS = ADMINS |
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
application: application-id #get from your google app engine when you create an application. | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /static | |
static_dir: static | |
- url: /.* |
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
db.products.aggregate([ | |
{$group: | |
{ | |
_id:"$manufacturer", | |
num_products:{$sum:1} | |
} | |
} | |
]) | |
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
#!/usr/bin/python | |
import fileinput | |
import glob | |
import sys | |
html_file_tpl = '/home/jinesh/Downloads/JSCover-0.2.6/output/javascript/testrunners/*.html' | |
searchExp = '/static/' | |
replaceExp = '../../' | |
def replace_static(html_file): |
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
" to add auto indetation " | |
set smartindent | |
set textwidth=79 " lines longer than 79 columns will be broken | |
set shiftwidth=4 " operation >> indents 4 columns; << unindents 4 columns | |
set tabstop=4 " a hard TAB displays as 4 columns | |
set expandtab " insert spaces when hitting TABs | |
set softtabstop=4 " insert/delete 4 spaces when hitting a TAB/BACKSPACE | |
set shiftround " round indent to multiple of 'shiftwidth' | |
set autoindent " align the new line indent with the previous line |
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 time | |
from reportlab.lib.enums import TA_JUSTIFY | |
from reportlab.lib.pagesizes import letter | |
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image | |
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle | |
from reportlab.lib.units import inch | |
doc = SimpleDocTemplate("form_letter.pdf",pagesize=letter, | |
rightMargin=72,leftMargin=72, | |
topMargin=72,bottomMargin=18) |
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 json | |
from django.http import HttpResponse | |
class JSONResponse(HttpResponse): | |
""" | |
Return a JSON serialized HTTP resonse | |
""" | |
def __init__(self, request, data, status=200): | |
serialized = json.dumps(data) | |
super(JSONResponse, self).__init__( |
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
from reportlab.lib import colors | |
from reportlab.lib.pagesizes import letter, inch | |
from reportlab.platypus import Image, Paragraph, SimpleDocTemplate, Table | |
from reportlab.lib.styles import getSampleStyleSheet | |
doc = SimpleDocTemplate("complex_cell_values.pdf", pagesize=letter) | |
# container for the 'Flowable' objects | |
elements = [] | |
styleSheet = getSampleStyleSheet() |
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
''' | |
Created on 15-Apr-2013 | |
@author: jinesh | |
''' | |
import xlrd | |
def update_subcustomers_list(file_contents, c_id): | |
""" read the data from excel file and save it into a database |
OlderNewer