Skip to content

Instantly share code, notes, and snippets.

View djtfmartin's full-sized avatar

Dave Martin djtfmartin

View GitHub Profile
@djtfmartin
djtfmartin / UK_state_province_layer.txt
Created August 27, 2015 15:37
Generate UK state province layer
# SHP import to PostGIS
shp2pgsql /Users/mar759/Downloads/bdline_essh_gb/Data/GB/european_region_region.shp scotland.european_region_region > /tmp/uk.sql
# SOL script
@djtfmartin
djtfmartin / species-autocomplete.js
Last active August 28, 2015 08:30
species-autocomplete.js
// initialise plugins
$(function(){
var autocompleteUrl = 'http://species-ws.als.scot/auto';
// autocomplete on navbar search input
$("input.general-search").autocomplete(autocompleteUrl, {
extraParams: {limit: 100},
dataType: 'json',
parse: function(data) {
@djtfmartin
djtfmartin / index.html
Last active August 29, 2015 13:56
ALA occurrence layer & Leafletjs
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Quick Start Guide Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://leafletjs.com/dist/leaflet.css" />
</head>
<body>
<div id="map" style=" height: 800px"></div>
@djtfmartin
djtfmartin / index.html
Created February 6, 2014 02:52
2 Species Layers with LeafletJS
<!DOCTYPE html>
<html>
<head>
<title>LeafletJS and ALA occurrence layer</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://leafletjs.com/dist/leaflet.css" />
</head>
<body>
<div id="map" style="height: 800px"></div>
@djtfmartin
djtfmartin / index.html
Created February 12, 2014 03:42
Display expert distribution map for Monacanthus chinensis
<html>
<head>
<title>Embed map image example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div id="expertDistroDiv">
<img src=""/>
</div>
@djtfmartin
djtfmartin / gist:121c27a6af249bc8fcd5
Created September 23, 2014 10:03
setfacts.yml that uses amazon CDN
- name: set debian variables
set_fact:
tomcat: tomcat7
tomcat_user: tomcat7
tomcat_conf: /etc/default/tomcat7
apache: apache2
mysql_service: mysql
cassandra_yaml: /etc/cassandra/cassandra.yaml
cassandra_user: cassandra
tomcat_webapps: /var/lib/tomcat7/webapps/
@djtfmartin
djtfmartin / setfacts.yml
Created September 23, 2014 10:04
setfacts.yml that uses amazon CDN
- name: set debian variables
set_fact:
tomcat: tomcat7
tomcat_user: tomcat7
tomcat_conf: /etc/default/tomcat7
apache: apache2
mysql_service: mysql
cassandra_yaml: /etc/cassandra/cassandra.yaml
cassandra_user: cassandra
tomcat_webapps: /var/lib/tomcat7/webapps/
@djtfmartin
djtfmartin / index.html
Created October 2, 2014 04:16
ALA mapping example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ALA Occurrence Records Map Example</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
@djtfmartin
djtfmartin / uk-inventory
Created December 15, 2014 04:54
UK demo inventory
# An inventory for the deployment of the ALA demo for the UK.
[ala-demo]
ec2-54-93-32-22.eu-central-1.compute.amazonaws.com
[ala-demo:vars]
is_vagrant=false
local_repo_dir = ~/.ala
data_dir=/data
use_cdn=true
@djtfmartin
djtfmartin / session.txt
Created December 15, 2014 05:06
Ansible bash session - EC2 setup
mar759@calamari-be:~/dev/ala-install/ansible$ date
Mon 15 Dec 2014 14:53:38 AEDT
mar759@calamari-be:~/dev/ala-install/ansible$ ansible-playbook --private-key ~/.ssh/uk-demo-frankfurt.pem -u ubuntu -s ala-demo.yml -i inventories/demo-ec2
PLAY [ala-demo] ***************************************************************
GATHERING FACTS ***************************************************************
ok: [ec2-54-93-32-22.eu-central-1.compute.amazonaws.com]
TASK: [common | set debian variables] *****************************************