Skip to content

Instantly share code, notes, and snippets.

View sharoonthomas's full-sized avatar

Sharoon Thomas sharoonthomas

View GitHub Profile
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": {}, "id":"Andhra Pradesh", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 80.149167, 13.618300 ], [ 80.142031, 13.544708 ], [ 80.126421, 13.584849 ], [ 80.158087, 13.591093 ], [ 80.120622, 13.605812 ], [ 80.149167, 13.618300 ] ] ], [ [ [ 82.258801, 16.689980 ], [ 82.285562, 16.697563 ], [ 82.368074, 16.723877 ], [ 82.311876, 16.602562 ], [ 82.258801, 16.689980 ] ] ], [ [ [ 82.299388, 16.714511 ], [ 82.293590, 16.743056 ], [ 82.211078, 16.727891 ], [ 82.221782, 16.750192 ], [ 82.174505, 16.725215 ], [ 82.257463, 16.689980 ], [ 82.292252, 16.608806 ], [ 82.259693, 16.586952 ], [ 82.299388, 16.591858 ], [ 82.267721, 16.564205 ], [ 82.309646, 16.567773 ], [ 81.720465, 16.309979 ], [ 81.364994, 16.359932 ], [ 81.345816, 16.330495 ], [ 81.392647, 16.342092 ], [ 81.231191, 16.235049 ], [ 81.145557, 15.973686 ], [ 81.004171, 15.840329 ], [ 81.006401, 15.757817 ], [ 80.943067, 15.719460 ], [ 80.822198, 15.712769 ], [ 80.78071
@sharoonthomas
sharoonthomas / gist:10221454
Created April 9, 2014 02:44
nginx configuration for SSL with better security
{
ssl on;
server_tokens off;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-RC4-SHA:ECDHE-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:RC4-SHA;
# HTTP Strict Transport Security
add_header Strict-Transport-Security max-age=31536000;
class Router(object):
def __init__(self):
self.methods = {}
def route(self, url):
def decorator(wrapped):
wrapped.__route_info__ = (self, url)
return wrapped
return decorator
def register(self, url, method):
self.methods[url] = method
@sharoonthomas
sharoonthomas / gist:f24a0faa3b31f0204308
Last active August 29, 2015 14:01
Example of why JSON262 cannot be used in the real world as critical information is lost in the serialization JSON object
@sharoonthomas
sharoonthomas / gist:72ff0af2809932d35426
Last active August 29, 2015 14:04
Using pip with Tryton modules
  1. Ensure that PIP is the latest version:

    pip install -U pip

  2. Installing a tryton module:

    pip install trytond_sale

    remember that it installs the most recent released version, as of this writing that is the 3.2 series.

@sharoonthomas
sharoonthomas / Dockerfile
Last active August 29, 2015 14:04
Example Dockerfile to setup tryton 3.2 with sale module and postgres
# Trytond 3.2 with Sale module and Postgres
#
# VERSION 3.2.0.1
FROM openlabs/tryton:3.2
MAINTAINER Sharoon Thomas <sharoon.thomas@openlabs.co.in>
# Setup psycopg2 since you want to connect to postgres
# database
RUN apt-get -y -q install python-dev libpq-dev
@sharoonthomas
sharoonthomas / dashboard.json
Last active August 29, 2015 14:04
Test JSON data for a dashboard
{
"sales_mtd": 120000
}

Keybase proof

I hereby claim:

  • I am sharoonthomas on github.
  • I am sharoonthomas (https://keybase.io/sharoonthomas) on keybase.
  • I have a public key whose fingerprint is E275 1DEF 5862 5069 F66D 6ED4 F87C 6A2D F9BB 6DF8

To claim this, I am signing this object:

@sharoonthomas
sharoonthomas / angular-tryton-party-service.js
Created November 21, 2014 11:25
Example of using angular tryton to fetch parties and addresses
'use strict';
angular.module('trytonCrmApp')
.factory('party', [
'session',
function (session) {
var getAll = function (domain, offset, limit) {
return session.rpc('model.party.party.search_read', [
domain || [], offset || null, limit || 20
]);
@sharoonthomas
sharoonthomas / gist:e8930945a01098f2af84
Created December 29, 2014 06:36
Installing nereid CMS
sh-3.2$ cd /tmp
sh-3.2$ virtualenv test-nereid-cms-install
New python executable in test-nereid-cms-install/bin/python2.7
Also creating executable in test-nereid-cms-install/bin/python
Installing setuptools, pip...done.
sh-3.2$ cd test-nereid-cms-install/
sh-3.2$ source bin/activate
sh-3.2$ which pip
/private/tmp/test-nereid-cms-install/bin/pip
sh-3.2$ pip install trytond-nereid-cms