Skip to content

Instantly share code, notes, and snippets.

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

Fernando Miño fernandor777

🏠
Working from home
  • Geosolutions
  • Ecuador
View GitHub Profile
/**
* This code uses Apache Chemistry (http://chemistry.apache.org/).
* License accords to Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@fernandor777
fernandor777 / pg dump sin esquema public
Last active August 29, 2015 14:01
Postgresql backup sin esquema public
pg_dump -h '127.0.0.1' -U 'sisapp' -F 'c' -n 'snigeo_*' -Z '5' geosni > /home/sambo_2014_05_20.backup

##注册一个servlet

@WebServlet(name = "captcha-servlet", value = "/getcaptcha")
public class CaptchaServlet extends HttpServlet {

}

GenericServlet要使用HttpServlet

CREATE OR REPLACE FUNCTION documental.ferunaccent(text)
RETURNS text AS
$BODY$
SELECT unaccent($1);
$BODY$
LANGUAGE sql IMMUTABLE
COST 100;
-- GIST:
@fernandor777
fernandor777 / center_div.css
Created May 20, 2014 21:23
Centrar div dentro de un div padre
.Center-Container {
position: relative;
}
.Absolute-Center {
width: 50%;
height: 50%;
overflow: auto;
margin: auto;
/**
* http://stackoverflow.com/questions/13459718/could-not-serialize-object-cause-of-hibernateproxy
*
* in bootstrap:
* import hbadapter.HibernateProxyTypeAdapter
*
* class BootStrap {
*
* def init = { servletContext ->
*
@fernandor777
fernandor777 / _TestWFS.java
Last active May 25, 2017 19:28
Geotools WFS query with CQL for get feature Bounding Box
public Bbox testWFS(){
String getCapabilities = "http://app.orbis/geoserver/ows?service=wfs&version=1.1.0&request=GetCapabilities";
Map connectionParameters = new HashMap();
connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", getCapabilities);
WFSDataStoreFactory dsf = new WFSDataStoreFactory();
try {
WFSDataStore dataStore = dsf.createDataStore(connectionParameters);
SimpleFeatureSource source = dataStore.getFeatureSource("catastro:geo_predio");
// cod_catast = 04-027-048-16
@fernandor777
fernandor777 / PredioRs.java
Created May 24, 2017 20:59
JAX-RS Streaming of Web Request file from geoserver WMS
package gob.libertad.geoapi.rest;
import gob.libertad.geoapi.predios.CatastroGeoConfigs;
import gob.libertad.geoapi.predios.PrediosService;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
@fernandor777
fernandor777 / zip_unzip.sh
Last active September 13, 2017 16:37
Unzip WAR, modify conf files, Zip war again for deploy
### unzip war:
unzip geoportal.war -d geoportal-war
mv geoportal.war geoportal-untouched.war
### edit conf:
# nano ............
### zip war:
cd geoportal-war/
zip -r ../geoportal.war *
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gob.libertad.geoapi.predios;
import javax.annotation.Resource;
import javax.ejb.Lock;
import javax.ejb.LockType;