Skip to content

Instantly share code, notes, and snippets.

View jarnaldich's full-sized avatar

Joan Arnaldich jarnaldich

View GitHub Profile
@jarnaldich
jarnaldich / catastro.ps1
Created April 20, 2022 05:46
[Catastro WebService Query in PowerShell] Query and process Xml Result for Catastro in PowerShell #xml #PowerShell #webservice
function Consulta_DPNRC($cod_parcela) {
$response = Invoke-WebRequest -UseBasicParsing -Uri "http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/OVCCallejero.asmx/Consulta_DNPRC" `
-Method "POST" `
-WebSession $session `
-Headers @{
"Accept"="text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
"Accept-Encoding"="gzip, deflate"
"Accept-Language"="es-419,es;q=0.9,en;q=0.8"
"Cache-Control"="no-cache"
@jarnaldich
jarnaldich / RasterGeoPackage.ps1
Created September 6, 2022 08:52
[Raster GeoPackage with Custom Tile Schema] Sample on generating a Raster GeoPackage with a Custom Tile Schema with GDAL 3 #gdal #geopackage #raster
function GetInfo {
param([string]$InputPath)
gdalinfo -json $InputPath | ConvertFrom-JSon -AsHashTable
}
function Urbana {
param(
[string]$InputPath,
[string]$OutputPath,
[String[]]$Bands=(1, 2, 3))
@jarnaldich
jarnaldich / delete_from_all_tables.sql
Created December 13, 2022 06:05
[ Delete from all tables in SQLITE ] Script to delete all tables from SQLITE #sqlite #sql #metaprogramming
.output wipe.sql
select 'DELETE FROM ' || name || ';' FROM sqlite_master WHERE type='table';
.output
.read wipe.sql
@jarnaldich
jarnaldich / PythonJSONPHelper.ipynb
Last active January 29, 2023 08:40
[JSONP Helper] in JupyterLite #cors #jupyterlite #python #javascript
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jarnaldich
jarnaldich / NearDuplicates.ipynb
Created March 18, 2023 08:25
[Near Duplicate Detection] #data #qc #jupyter #python #nltk #jaccard #levenshtein
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jarnaldich
jarnaldich / xml.st
Created March 21, 2023 13:40
[XML Processing in Pharo] #xml #pharo #smalltalk
Gofer it
smalltalkhubUser: 'PharoExtras' project: 'XMLParserHTML';
configurationOf: 'XMLParserHTML';
loadStable.
Gofer it
smalltalkhubUser: 'PharoExtras' project: 'XPath';
configurationOf: 'XPath';
loadStable.
@jarnaldich
jarnaldich / build.pro
Last active November 27, 2023 16:40
[Prolog as a build tool] Example for using Prolog to build something #prolog #make
:- use_module(library(http/http_open)).
:- use_module(library(http/http_client)).
:- use_module(library(uri)).
:- use_module(library(zip)).
:- use_module(library(pcre)).
:- initialization(main, main).
download(URL, File) :-
print_message(informational, ['Downloading', File]),