Skip to content

Instantly share code, notes, and snippets.

@seanlin
seanlin / gist:1143364
Created August 13, 2011 01:30
Python install error with GCC
studio912s-MacBook-Pro:~ seanlin$ brew install python --universal
Warning: Xcode is not installed! Builds may fail!
==> Downloading http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
File already downloaded in /Users/seanlin/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/python/2.7.2 --enable-universalsdk=/ --with-universal-archs=intel --enable-shared
==> make
/usr/bin/cc -c -fno-strict-aliasing -arch i386 -arch x86_64 -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/Cellar/readline/6.2.1/include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
/usr/bin/cc -c -fno-strict-aliasing -arch i386 -arch x86_64 -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/Cellar/readline/6.2.1/include -DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c
/usr/bin/cc -c -fno-strict-aliasing -arch i386 -arch x86_64 -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclud
@seanlin
seanlin / gist:1254376
Created September 30, 2011 17:09
HTML5 Geolocation with Google Map API V3
<div id="map-big" style="width:500px; height:300px"></div>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var locations = [
["Tanglin", 1.29559, 103.825607, 3],
["Orchard Turn", 1.30431, 103.831905, 2],
["Cityhall", 1.29308, 103.852226, 1],
];
if (navigator.geolocation) {
@seanlin
seanlin / helpers.py
Created November 17, 2011 06:48
Automatic geocoding in Django model
## Helper file to geocode address using Google Geocoder
import urllib, urllib2, simplejson
from django.utils.encoding import smart_str
def get_lat_lng(location):
# Reference: http://djangosnippets.org/snippets/293/
location = urllib.quote_plus(smart_str(location))