Skip to content

Instantly share code, notes, and snippets.

gotomypc /
Created Aug 15, 2012 — forked from erans/
Get Latitude and Longitude from EXIF using PIL
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
gotomypc / gist:3356643
Created Aug 15, 2012 — forked from sillygwailo/gist:2249822
Convert iPhone and BlackBerry latitude and longitudes in Twitter profiles to city name
View gist:3356643
* requires the GeoCoder PHP library
$f = fopen("File to read here", 'r+');
$o = fopen("File to write here", 'w+');
$g = new GeoCoder(' API key here');
while ($c = fgetcsv($f)) {
if ($c[0] != 'screen_name') {
gotomypc /
Created Aug 20, 2012 — forked from kanru/
Android GPS using libhardware
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
libcutils libhardware
LOCAL_MODULE:= test-gps
gotomypc / gist:3402841
Created Aug 20, 2012 — forked from granoeste/gist:1024384
View gist:3402841
// copy from
private LocationManager mLocationManager;
private String mBestProvider;
public void onCreate(Bundle savedInstanceState) {
// 位置情報サービスマネージャを取得
View redis_pubsub_demo.rb
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# Install gcc44 package and update-alternatives (in chkconfig)
yum -y install gcc44 chkconfig
# Check if gcc is already a link
if [ ! -L /usr/bin/gcc ]; then mv /usr/bin/gcc /usr/bin/gcc41; fi
if [ ! -L /usr/bin/g++ ]; then mv /usr/bin/g++ /usr/bin/g++41; fi
# Install update-alteratives links for gcc41 and gcc44
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc41 60 --slave /usr/bin/g++ g++ /usr/bin/g++41
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc44 40 --slave /usr/bin/g++ g++ /usr/bin/g++44
# Select gcc44 to compile gecode-3.5.0 in chef::bootstrap_server
update-alternatives --config gcc
gotomypc / index.js
Created Oct 27, 2012 — forked from eugenehp/index.js
Chrome scrapper
View index.js
var express = require('express');
var cp = require('child_process');
var Chrome = require('./lib/chrome');
var Remote = require('./lib/remote');
var app = express.createServer();
app.use(express.static(__dirname + '/public'));
gotomypc / reverse-ip-lookup.js
Created Oct 27, 2012 — forked from eugenehp/reverse-ip-lookup.js
node.js IP reverse lookup
View reverse-ip-lookup.js
var dns = require('dns');
function reverseLookup(ip) {
if(err!=null) callback(err);
dns.lookup(domain,function(err, address, family){
gotomypc / output
Created Oct 27, 2012 — forked from eugenehp/output
parse images
View output
var http = require('http');
var jsdom = require('jsdom');
var url = "";
var options = {
host: '',
port: 80,
path: '/articles/695-top-ten-sexiest-exploits-of-uk-olympic-gold-medal-winners-hopefully',
method: 'GET'
gotomypc / NodeJS web scraper for Anagrams
Created Oct 28, 2012 — forked from daithiw44/NodeJS web scraper for Anagrams
NodeJS Web Scraper Anagram Example, written as a test some time ago with early Node Version, seems to still work.
View NodeJS web scraper for Anagrams
//Web Scraper that scrapes a web page (without permission I may add).
//Simple test using node is all this is, no error handling etc.
//Returns JSON OR XML
//Format : localhost:'PORT'/scrape/'WORD'/'FORMAT'
//Example CURL
//JSON - curl -X GET http://localhost:3000/scrape/fundamental/json
//XML - curl -X GET http://localhost:3000/scrape/fundamental/xml
var express = require('express'),
request = require('request'),