Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})

Map tweets from a place

This is a very simple node-based client demonstrating how you can use the Twitter streaming API with the locations parameter specified. It uses geojson.io to map any tweets it hears within a user-specified duration.

Setup

Before running the map.coffee script, place your app's OAuth keys in keys.json and run npm install to install dependencies (viz., ntwitter and opener).

Simple client for listening to a Twitter user stream via version 1.1 of the streaming API.

Before running demo.coffee, place your app's OAuth keys in keys.json


This is basically a coffescript translation of @aivis' user-stream.

get the FileGDB API http://www.esri.com/apps/products/download/
extract it somewhere on your system and remember the path :)
mkdir build #directory where we are playing around
cd build
git clone https://github.com/OSGeo/gdal.git
cd gdal
./configure --with-fgdb=/path/to/your/FileGDB_API
make
(make install) optional, I'm just using it locally

Building GDAL 1.9.x with ESRI FileGDB support on OS X Lion

  • Download the SDK from ESRI's website http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api
  • Extract the SDK, and put the contents of the directory in a known location, I used ~/local/filegdb. Here's an example path to one of the files: ~/local/filegdb/lib/libFileGDBAPI.dylib
  • I use ~/local/filegdb so it can stay isolated in it's own place. You can put it anywhere, but the next few steps might be different.
  • Go into the directory containing the FileGDB SDK, e.g. ~/local/filegdb
  • ESRI built these dylib's using @rpath's, so to avoid needing to mess with DYLD_LIBRARY_PATH, I updated the @rpath's using install_name_tool. There might be a more elegant way to handle this. If so, comments are welcome!
  • Here are the commands I used to patch the dylibs, this is not required if you want to use DYLD_LIBRARY_PATH yourself:
{
"address": {
"administrative": "Paris",
"city": "Paris",
"country": "France",
"country_code": "fr",
"county": "Paris",
"postcode": "75004",
"road": "Rue des Francs Bourgeois",
"state": "\u00cele-de-France",
@jalbertbowden
jalbertbowden / example.html
Created December 31, 2013 22:52 — forked from sandfox/example.html
Using KDTree for geospatial lookups (slightly experimental) (this is an untested example) via https://gist.github.com/sandfox/85f5ab526a9158b2cd30
<!Doctype html>
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js"></script>
<script src="script.js"></script>
</head>
<a id="button" href="#">
<p>I AM A BUTTON</p>
</a>
/**************************************************************************
* OSM2GEO - OSM to GeoJSON converter
* OSM to GeoJSON converter takes in a .osm XML file as input and produces
* corresponding GeoJSON object.
*
* AUTHOR: P.Arunmozhi <aruntheguy@gmail.com>
* DATE : 26 / Nov / 2011
* LICENSE : WTFPL - Do What The Fuck You Want To Public License
* LICENSE URL: http://sam.zoy.org/wtfpl/
*
@jalbertbowden
jalbertbowden / ocr.js
Created January 25, 2014 09:50 — forked from joemccann/ocr.js
var ncr = require('nodecr')
, request = require('request')
, fs = require('fs')
, test_img = 'https://www.google.com/images/srpr/logo3w.png' // Change this to your image
// Create image name from end of URL.
// Note this will fail in loads of cases.
var imgName = test_img.split('/').pop()
// Process the image and read the text from it using Tesseract
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">