Skip to content

Instantly share code, notes, and snippets.

@max-mapper
max-mapper / index.js
Created November 27, 2012 01:28
link to lat/lon in native maps app on ios and android from webview (phonegap)
var mapLink = "http://maps.google.com/maps?z=12&t=m&q=loc:" + lat + "+" + lon
if ($.os.ios && navigator.userAgent.match(/iPhone OS 6_/)) mapLink = "Maps://?q=" + lat + "," + lon
if ($.os.android) mapLink = "geo:" + lat + "," + lon + "?z=12&q=" + lat + "," + lon
// assumes you have zepto and zepto.detect loaded
// also you should use target=_blank on your <a> tags
@dresende
dresende / ldapjs-addrbook.js
Created August 26, 2011 18:06
LDAP Addressbook using ldapjs
// MySQL test: (create on database 'abook' with username 'abook' and password 'abook')
//
// CREATE TABLE IF NOT EXISTS `users` (
// `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
// `username` varchar(50) NOT NULL,
// `password` varchar(50) NOT NULL,
// PRIMARY KEY (`id`),
// KEY `username` (`username`)
// ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
// INSERT INTO `users` (`username`, `password`) VALUES