Skip to content

Instantly share code, notes, and snippets.

View marcellobenigno's full-sized avatar

Marcello Benigno marcellobenigno

  • João Pessoa / Paraíba / Brazil
View GitHub Profile
@bmcbride
bmcbride / postgis_geojson.php
Created February 26, 2012 05:43
PHP PostGIS to GeoJSON
<?php
/**
* PostGIS to GeoJSON
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc.
*
* @param string $geotable The PostGIS layer name *REQUIRED*
* @param string $geomfield The PostGIS geometry field *REQUIRED*
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)*
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes
* @param string $parameters SQL WHERE clause parameters *OPTIONAL*

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@g3d
g3d / gist:2709563
Last active February 7, 2024 15:21 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
@akkerman
akkerman / Install PostGIS and GeoServer on Ubuntu 13.04.md
Last active May 28, 2023 01:53
Install PostGIS and GeoServer on Ubuntu 13.04

Install PostGIS and GeoServer on Ubuntu 13.04

PostGIS installation

Postgresql

Install the server:

sudo apt-get install postgresql-9.1 postgresql-contrib-9.1 pgadmin3

Execute the psql command under user postgres (sudo -u postgres)
and connect to database postgres (psql postgres):

@marcellobenigno
marcellobenigno / testes_postgis_raster.sql
Last active December 26, 2015 02:59
Testes_PostGIS_Raster
-- Abordagem tradicional (vetor/vetor):
SELECT foo.value, ST_area(foo.geom::geography)/10000 AS area_ha
FROM ( SELECT c.value,
ST_Union(ST_Intersection(f.geom, c.geom)) as geom
FROM fazendas f, capacidade_vect c
WHERE ST_Intersects(f.geom, c.geom)
AND f.gid = 6
GROUP BY c.value
) as foo
ORDER BY foo.value;
@leocomelli
leocomelli / git.md
Last active November 17, 2024 13:52
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@clhenrick
clhenrick / README.md
Last active September 25, 2024 08:26
PostgreSQL & PostGIS cheatsheet (a work in progress)
@soifou
soifou / iTerm2.md
Last active August 31, 2024 17:26
iTerm2 Shortcuts

iTerm2 Shortcuts

Tab navigation

  • open new tab: Cmd + t
  • next tab: Cmd + Shift + ]
  • previous tab: Cmd + Shift + [

Pane navigation

@rg3915
rg3915 / boilerplate2.sh
Last active February 17, 2023 11:53
Boilerplate: Shell script to create a complete Django project in Mac with Python 3.7 and Django 2.2.12
# Shell script to create a complete Django project.
# This script require Python 3.x and pyenv
# Settings.py is config to Django 2.2.12
# The project contains:
# Settings config
# Person model and form
# Person list and detail
# Person create, update and delete
# Admin config