Skip to content

Instantly share code, notes, and snippets.

View jgrocha's full-sized avatar
🏠
Working from home

Jorge Gustavo Rocha jgrocha

🏠
Working from home
  • Geomaster, Lda
  • Braga, Portugal
View GitHub Profile
@jgrocha
jgrocha / gfi.js
Last active February 7, 2016 23:42
parse and transform a GetFeatureInfo request using ExtJS 6
Ext.define('FeatureProperty', {
extend: 'Ext.data.Model',
fields: [{
name: 'prop',
type: 'string'
}, {
name: 'value',
type: 'string'
}]
});
@jgrocha
jgrocha / opentripplanner.sh
Created January 19, 2016 19:26
Startup script for OpenTripPlanner (/etc/init.d/opentripplanner)
#!/bin/sh
NAME=opentripplanner
JAR=/home/jgr/otp/otp-0.19.0-SNAPSHOT-shaded.jar
BASE=/home/jgr/otp
PIDFILE="/var/run/$NAME.pid"
case $1 in
start)
echo "Starting $NAME ..."
if [ ! -f $PIDFILE ]; then
cd $BASE
@jgrocha
jgrocha / servidor.py
Created June 8, 2015 08:30
Moon phases based on pyephem
#-*- coding: utf-8 -*-
from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse
import ephem, datetime
import json
# Phases of the Moon, using the datetime.now() at UTC
# http://127.0.0.1:8899/
# Phases of the Moon, using the datetime.datetime(int(year), int(month), int(day))) at UTC
@jgrocha
jgrocha / printWMTS.json
Last active August 29, 2015 14:16
MapFish print request using WMTS layer
{
"attributes": {
"map": {
"center": [-26000, 100500],
"dpi": 72,
"layers": [{
"type": "WMTS",
"baseURL": "http://a.geomaster.pt/mapproxy/wmts/osm/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png",
"opacity": 1,
"layer": "osm",
@jgrocha
jgrocha / column.html
Created April 24, 2014 09:48
ExtJS Three column layout inside tabpanel
<html>
<head>
<title>Column Layout</title>
<!-- GC -->
<style type="text/css">
html, body {
font: normal 12px verdana;
margin: 0;