Skip to content

Instantly share code, notes, and snippets.

@rgamez
rgamez / project.json
Created April 21, 2016 10:57
COBWEB project.json with repositories instead of package names
{
"versions":{
"core": "cobweb",
"project": "0.2.2"
},
"plugins":{
"cordova": [
"https://github.com/apache/cordova-plugin-camera.git#0.3.6",
"https://github.com/apache/cordova-plugin-console.git#0.2.13",
"https://github.com/apache/cordova-plugin-device.git#0.3.0",
@rgamez
rgamez / fieldtrip-editor.edtr
Created December 15, 2015 16:02
fieldtripGB editor
<form id="form1062" data-ajax="false" novalidate>
<div class="fieldcontain" id="fieldcontain-text-1">
<label for="form-text-1">Title</label>
<input name="form-text-1" id="form-text-1" type="text" required="" placeholder="Placeholder" maxlength="10">
</div>
<div class="fieldcontain" id="fieldcontain-radio-1">
<fieldset data-role="controlgroup">
<legend>Choose</legend>
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-3.198739768360548,
55.947545863410696
]
},
"properties": {
@rgamez
rgamez / survey-proposal-arrrays-everywhere.json
Last active January 19, 2016 17:41
Add image/camera field
{
"title": "OPAL Tree Health",
"geoms": [
"point"
],
"layout": {
"elements": [
{
"type": "section",
"id": "form-section-1",
{
"title": "OPAL Tree Health",
"geoms": [
"point"
],
"layout": {
"pages": [
{
"type": "page",
"id": "form-section-1",
@rgamez
rgamez / pcapi-1.3.md
Last active November 30, 2015 15:31
Functionalities of the PCAPI 1.3
  • Records
    • Create
    • Read
    • Update
    • Delete
    • List
    • Filter
      • by Editor
      • by Location
  • by mimetype (?)
{
"title": "OPAL Tree Health",
"geoms": [
"point"
],
"form-section-1": {
"label": "A. Start surveying"
},
"form-text-1": {
"label": "1. Date of survey",
#!/usr/bin/env node
// Usage cat records.json | ./json_by_lines.js
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin
});
@rgamez
rgamez / pp_json_bom.js
Last active October 19, 2015 18:32
Pretty print a json skipping the BOM if present
#!/usr/bin/env node
var fs = require('fs');
process.stdout.on('error', function(err) {
if (err.code == "EPIPE") {
process.exit(0);
}
});
@rgamez
rgamez / records2kmz.py
Created June 18, 2015 09:40
FieldtripGB Records to KMZ
from __future__ import print_function
import simplekml
import json
BASE_PATH = 'wales-observations/records'
def convertToKML(records):
kml = simplekml.Kml()