Skip to content

Instantly share code, notes, and snippets.

View jineshpaloor's full-sized avatar

Jinesh Panampattakunnath jineshpaloor

View GitHub Profile
@jineshpaloor
jineshpaloor / main.py
Created December 7, 2011 09:19
Main.py file for GAE hosting
# Standard Python imports.
import os
import sys
import logging
import __builtin__
# Google App Hosting imports.
from google.appengine.ext.webapp import util
@jineshpaloor
jineshpaloor / settings.py
Created December 7, 2011 09:21
settings.py for GAE hosting
# Django settings for graphcoloring project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
@jineshpaloor
jineshpaloor / app.yaml
Created December 7, 2011 09:32
app.yaml file for GAE hosting
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: /.*
db.products.aggregate([
{$group:
{
_id:"$manufacturer",
num_products:{$sum:1}
}
}
])
#!/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):
@jineshpaloor
jineshpaloor / .vimrc
Last active December 17, 2015 05:38
My .vimrc file
" 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
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)
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__(
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()
'''
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