View delete_from_all_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.output wipe.sql | |
select 'DELETE FROM ' || name || ';' FROM sqlite_master WHERE type='table'; | |
.output | |
.read wipe.sql |
View RasterGeoPackage.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetInfo { | |
param([string]$InputPath) | |
gdalinfo -json $InputPath | ConvertFrom-JSon -AsHashTable | |
} | |
function Urbana { | |
param( | |
[string]$InputPath, | |
[string]$OutputPath, | |
[String[]]$Bands=(1, 2, 3)) |
View catastro.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
View out.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from affine import dumpsw | |
ts = rio.transform.from_gcps(ds.gcps[0]) | |
open(r"e:\public\aerot\1988040011117.tfw", 'w').write(dumpsw(ts)) |
View etl.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
{- | |
stack | |
--install-ghc runghc | |
--package aeson | |
--package lens-aeson | |
--package xml-lens | |
-} | |
{-# Language OverloadedStrings #-} | |
import Control.Monad.Reader |
View xml2json.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
{- | |
stack | |
--install-ghc runghc | |
--package aeson | |
--package aeson-pretty | |
--package lens-aeson | |
--package xml-lens | |
-} | |
{-# LANGUAGE OverloadedStrings #-} |
View autoargs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Also check data classes and collections for this | |
import inspect | |
import functools | |
def autoargs(*include,**kwargs): | |
def _autoargs(func): | |
attrs,varargs,varkw,defaults=inspect.getargspec(func) | |
def sieve(attr): | |
if kwargs and attr in kwargs['exclude']: return False |
View json2csv.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq.exe --% -r ".result | map([(.doy|tostring), .timestamp, (.val|tostring), (.interpol|tostring)] | join(\",\")) | join(\"\n\")" rasdaman.json |
View table_columns.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW table_columns AS | |
WITH table_oids AS ( | |
SELECT c.relname, c.oid | |
FROM pg_catalog.pg_class c | |
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace | |
WHERE | |
pg_catalog.pg_table_is_visible(c.oid)), | |
column_types AS ( | |
SELECT | |
toids.relname AS "tablename", |
View Main.purs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Proposed Purescript Solution for: https://github.com/josevalim/nested-data-structure-traversal | |
-- Pure solution (no mutability), Strongly Typed (try to mess around, eg, misspelling an attribute) | |
-- Nothing fancy (no optics), just the usual pure functional artillery (foldl, zipWith...) | |
-- plus the convenience of extendable row types in Purescript. A seasoned Purescript dev may improve | |
-- on this, though... | |
module Main where | |
import Prelude | |
import Data.Array (zipWith, length, (..), snoc) |
NewerOlder