Skip to content

Instantly share code, notes, and snippets.

View adamfowleruk's full-sized avatar

Adam Fowler adamfowleruk

View GitHub Profile
<link rel="stylesheet" type="text/css" href="/css/widgets.css" />
<script type="text/javascript" src="/js/mldb.js"></script>
<script type="text/javascript" src="/js/mldb-jquery.js"></script>
<script type="text/javascript" src="/js/widgets.js"></script>
<script type="text/javascript" src="/js/widget-search.js"></script>
<script type="text/javascript" src="/js/page-search-main.js"></script>
<div id="search-content">Search content goes here</div>
@adamfowleruk
adamfowleruk / mldb-create-db.js
Last active December 15, 2015 10:19
MarkLogic World 2013 - MLDB talk
var dosomething = function() { /* whatever */ };
var db = new mldb(); // default options
db.exists(function(result) {
if (!result.inError) {
if (result.exists) {
// already exists
dosomething();
} else {
// create then destroy
@adamfowleruk
adamfowleruk / 001-article-main.xqy
Created November 1, 2012 17:53
article controller main function
declare function c:main() as item()*
{
let $acount := xdmp:estimate((fn:doc()/article))
return
(
ch:add-value("articlecount",$acount),
ch:add-value("title", "Articles")
)
};
@adamfowleruk
adamfowleruk / gpscompassread.c
Created July 14, 2014 15:50
Sending GPS and Compass information to hardware serial on Arduino Pro Mini with UBlox GPS and HMC5883L compass chip (Airbot UBlox 2.0 module)
#include <nmea.h>
#include <SoftwareSerial.h>
#include <Wire.h>
SoftwareSerial mySerial(2, 3); // RX, TX
NMEA nmeaDecoder(ALL);
void setup() {
// Open serial communications and wait for port to open:
Wire.begin();
@adamfowleruk
adamfowleruk / gpsprinter.c
Created July 13, 2014 22:51
NMEA decoder and Airbot UBlox GPS working on Arduino Pro Mini 3.3V
#include <nmea.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX - change for your connections
NMEA nmeaDecoder(ALL);
void setup()
{
// Open serial communications and wait for port to open: