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
#lang racket | |
(provide my-match-lambda* | |
(struct-out my-match-lambda-procedure) | |
my-match-lambda-append | |
my-match-lambda-add-clause! | |
my-match-lambda-add-overriding-clause! | |
(struct-out exn:fail:my-match-lambda:no-match) | |
(struct-out exn:fail:my-match-lambda:no-match:next-clause) | |
raise-my-match-lambda:no-match-error) |
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 | |
--resolver lts-4.2 | |
--install-ghc runghc | |
--package xml-lens | |
--package directory-tree | |
-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where |
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 Sample-Count-Files { | |
[CmdletBinding()] | |
param( | |
# The file pattern to count | |
[Parameter(Mandatory=$true, | |
Position=0)] | |
[string]$pattern, | |
# Name of the log file |
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 xml-lens | |
-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import System.Environment (getArgs) | |
import Text.XML |
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 --resolver lts-12.20 --install-ghc runghc | |
--package random --package async --package stm-chans --package wreq --package cassava | |
-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE NamedFieldPuns #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
import Control.Exception | |
import Control.Concurrent.Async (mapConcurrently, concurrently) |
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
$w = New-Object System.IO.FileSystemWatcher | |
$w.Path= pwd | |
$w.Filter= "*.py" | |
$w.EnableRaisingEvents = $true | |
$action = { (&{ cls; $p = $Event.SourceEventArgs.FullPath; python $p }) 2>&1 | Write-Host } | |
$changed = Register-ObjectEvent $w "Changed" -Action $action | |
Unregister-Event $changed.Id |
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
TXTS=$(shell CMD /C DIR /B Z:\mrsids\params) | |
OUT=\\icgc.local\dades\datacloud_2\of5m_ETRS89\sid_ed50\\ | |
OUTS=$(patsubst %.tif,$(OUT)%.tif,$(TXTS:.txt=.tif)) | |
SIDS=$(patsubst %.sid,$(OUT)%.sid,$(TXTS:.txt=.sid)) | |
target: $(SIDS) | |
$(OUT)%.tif : Z:\mrsids\params\%.txt | |
\\icgc.local\aplicacions\produccio\DFApplications\ICCImageOperationsGeocorrection\exe\ICCImageGeoTransformation.exe < $< |
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
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 |
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
#!/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 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'; |
OlderNewer