This file contains hidden or 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 |
This file contains hidden or 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 |
This file contains hidden or 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", |
This file contains hidden or 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) |
This file contains hidden or 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
# Check version | |
lsb_release -a | |
# Install zsh oh my zsh... | |
sudo apt install zsh | |
sudo apt-get install powerline fonts-powerline | |
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1 | |
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc" |
This file contains hidden or 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
def copy_extent_to_clipboard(separator=';'): | |
ext = iface.mapCanvas().extent() | |
coords = [ ext.xMinimum(), ext.yMinimum(), ext.xMaximum(), ext.yMaximum() ] | |
txt = separator.join([ "{:10.4f}".format(x) for x in coords ]) | |
QgsApplication.clipboard().setText(txt) | |
# Run: exec(open('C:/Users/j.arnaldich/copy_extent_to_clipboard.py'.encode('utf-8')).read()) |
This file contains hidden or 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
#!/bin/bash | |
SRC=$1 | |
DST=$2 | |
rio calc --co COMPRESS=LZW --co BIGTIFF=YES -t uint8 "(asarray (/ (+ 3278 (read 1 1)) 256) (mod (+ 3278 (read 1 1)) 256) (* 256 (- (+ 3278 (read 1 1)) (floor (+ 3278 (read 1 1))))))" $SRC $DST |
This file contains hidden or 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
#!/bin/bash | |
SRC_DBNAME=$1 | |
TARGET_DBNAME=$2 | |
DATE=`date +%Y%m%d` | |
PGPASSWORD=$SRCPASS /usr/lib/postgresql/9.5/bin/pg_dump -F c --file /mnt/d/public/lliscat_$DATE.backup --host 172.30.22.110 --username postgres --format=c --blobs $SRC_DBNAME | |
PGPASSWORD=$DSTPASS psql -h phineas -U postgres <<END | |
SELECT pg_terminate_backend(pid) | |
FROM pg_stat_activity | |
WHERE pid <> pg_backend_pid() AND datname = '$TARGET_DBNAME'; |
This file contains hidden or 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
#!/bin/bash | |
# To install dotnet on windows choco install -y dotnetcore-sdk | |
PRJ=$1 | |
dotnet new console -lang F# -o $PRJ | |
cd $PRJ | |
dotnet add package FSharp.Data | |
# The only working one I could find... | |
dotnet add package -v 2.4.2 GDAL.Native |
This file contains hidden or 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
sudo apt-get purge openssh-server | |
sudo apt-get install openssh-server | |
sudo apt install -y zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
# Can change THEME to agnoster in .zshrc | |
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage | |
chmod u+x nvim.appimage |