Skip to content

Instantly share code, notes, and snippets.

View gledsoncruz's full-sized avatar

Gledson Cruz gledsoncruz

View GitHub Profile
source 'https://rubygems.org'
gem 'rails', '3.2.12'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'sqlite3'
gem 'pg'
@gledsoncruz
gledsoncruz / gist:9528615
Created March 13, 2014 13:36
Instalação do rubyOnRails rvm mac os
# Make sure xCode 4.3 is installed first!!!
# Command line tools no longer come bundled with xCode, install it by going to:
preferences -> downloads -> command line tools
# Install RVM
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
# Then restart terminal
@gledsoncruz
gledsoncruz / map.js
Created April 3, 2014 19:51
Leaflet - Configurando o Mapa
L.Icon.Default.imagePath = "/assets"
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/{styleId}/256/{z}/{x}/{y}.png',
cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade';
var nightTime = L.tileLayer(cloudmadeUrl, {
styleId:999
});
var googleRoadMap = new L.Google('ROADMAP');
@gledsoncruz
gledsoncruz / sql_union_polygons.sql
Last active August 29, 2015 13:58
SQL Postgis para gerar um poligono com a união de 2 ou mais
INSERT INTO setores_op(descricao, the_geom) VALUES ('Setor 6',
(SELECT ST_Union(ARRAY(SELECT the_geom FROM bairros WHERE gid IN (22,23)))));
@gledsoncruz
gledsoncruz / exterior_ring.sql
Last active August 29, 2015 13:58
Usando st_exteriorRing para eliminar vertices interiores
UPDATE setores_op
SET the_geom=(SELECT ST_Polygon(ST_ExteriorRing(the_geom), 29193)
FROM setores_op WHERE gid = 10)WHERE gid = 10;
@gledsoncruz
gledsoncruz / gist:11298439
Last active August 29, 2015 14:00
conf_gemfile
gem 'pg'
gem 'rgeo'
gem 'rgeo-geojson'
gem 'activerecord-postgis-adapter', '~> 0.6.3'
@gledsoncruz
gledsoncruz / soma_areas_ocupadas_por_zonas.sql
Last active August 29, 2015 14:03
soma_areas_ocupadas_por_zonas
SELECT b.id, ROUND(SUM(ST_AREA(e.the_geom)/1000)::numeric,2) as area_ocupada,
ROUND(ST_AREA(b.the_geom)::numeric/1000,2) as area_zona
FROM areas_ocupadas e, gis.zoneamentos b
WHERE ST_INTERSECTS(e.the_geom, b.the_geom)
GROUP BY b.id, b.the_geom
ORDER BY b.id;
SELECT st_astext(lote_vizinho.the_geom) AS lotes_vizinhos
FROM lotesvr lvr, lotesvr lote_vizinho
WHERE lvr.gid = 46610 AND
lote_vizinho.gid <> 46610 AND
st_touches(lvr.the_geom, lote_vizinho.the_geom);
@gledsoncruz
gledsoncruz / products.json
Created September 29, 2014 14:36
exemplos produtos json
[
{
"id":1,
"name":"Jaleco",
"description":"Jaleco de alta qualidade fabricado para atender aos clientes mais exigentes",
"price":"R$ 999,99",
"available":true
},
{
geo@ubuntu-10-teste:/opt/BonitaBPMCommunity-6.5.2-Tomcat-7.0.55/logs$ vim bonita.2015-12-21.log
2015-12-21 15:04:02 org.bonitasoft.console.common.server.login.datastore.LoginDatastore
SEVERE: Error while logging in the engine API.
2015-12-21 15:05:29 org.bonitasoft.console.common.server.login.datastore.LoginDatastore
SEVERE: Error while logging in the engine API.
2015-12-21 15:43:17 org.bonitasoft.console.common.server.login.datastore.LoginDatastore
SEVERE: Error while logging in the engine API.
2015-12-21 15:43:33 org.bonitasoft.console.common.server.login.datastore.LoginDatastore
SEVERE: Error while logging in the engine API.
2015-12-21 15:43:47 org.bonitasoft.console.common.server.login.datastore.LoginDatastore