Skip to content

Instantly share code, notes, and snippets.

View pomahtuk's full-sized avatar

Ilia Loriakov pomahtuk

View GitHub Profile
"40.71399899774998,-73.96226638749108|40.71444900225002,-73.9606376125089"
coords = [40.714224,-73.961452]
lng_corr = 0.05 / (Math.cos(coords[1] * Math.PI / 180) * 111.11) / 2
lat_corr = 0.05 / 111.11 / 2
bounds = [[coords[0] - lat_corr,coords[1] - lng_corr],[coords[0] + lat_corr, coords[1] + lng_corr]]
bounds_string = bounds[0].join(',') + '|' + bounds[1].join(',');
import hashlib
import re
from datetime import *
from django.db import connection
from django.conf import settings
from django.core import serializers
import simplejson as json
def date_conv(obj):
import calendar, datetime
@pomahtuk
pomahtuk / passenger_standalone_production.sh
Created November 7, 2012 17:31 — forked from seabre/passenger_standalone_production.sh
Start Passenger Standalone in Production Mode
#For some reason, this took forever to figure out...
passenger start -a 127.0.0.1 -p 3000 -d -e production
@pomahtuk
pomahtuk / coffe_color_overlay.coffee
Created October 23, 2012 07:09
Color Overlay Coffe function
@count_overlay = (color, overlay) ->
# First part: If Lower Layer Value > 127.5, then do the following -
# Value Unit = (255-Lower Layer Value)/127.5
# Min Value = Lower Layer Value - (255-Lower Layer Value)
# Overlay = (Upper Layer Value * Value Unit) + Min Value
# Second part: If Lower Layer Value < 127.5, then do the following -
# Value Unit=Lower Layer Value/127.5
# Overlay = Upper Layer Value * Value Unit
color = parseInt(color)
overlay = parseInt(overlay)