This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* requires the GeoCoder PHP library https://github.com/sillygwailo/GeoCoder | |
*/ | |
include_once("./GeoCoder/GeoCoder.php"); | |
$f = fopen("File to read here", 'r+'); | |
$o = fopen("File to write here", 'w+'); | |
$g = new GeoCoder('geocoder.ca API key here'); | |
while ($c = fgetcsv($f)) { | |
if ($c[0] != 'screen_name') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH:= $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_SRC_FILES:= \ | |
gps.cpp | |
LOCAL_SHARED_LIBRARIES := \ | |
libcutils libhardware | |
LOCAL_MODULE:= test-gps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy from http://goo.gl/NxT8B | |
private LocationManager mLocationManager; | |
private String mBestProvider; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// 位置情報サービスマネージャを取得 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.bodyParser()); | |
app.use(app.router); | |
app.use(express.static(__dirname + '/public')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dns = require('dns'); | |
function reverseLookup(ip) { | |
dns.reverse(ip,function(err,domains){ | |
if(err!=null) callback(err); | |
domains.forEach(function(domain){ | |
dns.lookup(domain,function(err, address, family){ | |
console.log(domain,'[',address,']'); | |
console.log('reverse:',ip==address); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var jsdom = require('jsdom'); | |
var url = "http://deathtoglamour.com/articles/695-top-ten-sexiest-exploits-of-uk-olympic-gold-medal-winners-hopefully"; | |
var options = { | |
host: 'deathtoglamour.com', | |
port: 80, | |
path: '/articles/695-top-ten-sexiest-exploits-of-uk-olympic-gold-medal-winners-hopefully', | |
method: 'GET' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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'), |
OlderNewer