Skip to content

Instantly share code, notes, and snippets.

@wadey
wadey / example-server.js
Created December 31, 2010 20:16
Example node-thrift server
var thrift = require('thrift');
var JobExchange = require('./gen-nodejs/JobExchange'),
ttypes = require('./gen-nodejs/scheduler_types');
var server = thrift.createServer(JobExchange, {
insert_job: function(job, callback) {
// job is an instance of ttypes.Job
process.nextTick(function() {
callback(1);
@wadey
wadey / get_location_1.js
Created December 21, 2010 22:27
SimpleGeo JavaScript getLocation examples
client.getLocation({enableHighAccuracy: true}, function(err, position) {
if (err) {
// Could not retrieve location information. Check err for more information
} else {
// Latitude and longitude available in position.coords
}
});
@wadey
wadey / index.html
Created December 3, 2010 22:06
SimpleGeo Advanced getLocation Example
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="http://cdn.simplegeo.com/js/1.2/simplegeo.context.jq.min.js"></script>
<script type="text/javascript" src="http://github.com/simplegeo/polymaps/raw/v2.4.0/polymaps.js"></script>
</head>
<body>
<script type="text/javascript">
@wadey
wadey / twitter-entities.js
Created June 17, 2010 17:50
JavaScript parser for Tweet Entities
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license