I hereby claim:
- I am matoous on github.
- I am matousdz (https://keybase.io/matousdz) on keybase.
- I have a public key ASDbTE8pF-UKuCJv3_Zem6t9p_9ZBwOG-Wh5PgoJNT0jFgo
To claim this, I am signing this object:
-- Haskell suffix calculator (Polish notation) | |
import Data.List | |
suffixCalc :: (Num a, Read a) => String -> a | |
-- other option is to write this: | |
-- suffixCalc x = head $ foldl calcFun [] $ words x | |
suffixCalc = head . foldl calcFun [] . words | |
where | |
calcFun (a:b:bs) "+" = (a + b):bs | |
calcFun (a:b:bs) "-" = (b - a):bs |
permutate :: (Eq a) => [a] -> [[a]] | |
permutate [] = [[]] | |
permutate l = [a:x | a <- l, x <- permutate $ filter (\x -> x /= a) l] |
powerset :: [a] -> [[a]] | |
powerset [] = [[]] | |
powerset (a:b) = map (a:) p ++ p | |
where p = powerset b |
#lang scheme | |
(define (rbp n) | |
(define (help canBeRed n) | |
(if (= n 0) 1 | |
(if canBeRed (+ (help #t (- n 1)) (help #f (- n 1))) | |
(help #t (- n 1))))) | |
(help #t n)) |
#lang scheme | |
(define new-list '(() ())) | |
(define (left l) (car l)) | |
(define (right l) (car (cdr l))) | |
(define (insert x l) | |
(list (left l) (cons x (right l)))) |
normalize :: [Double] -> [Double] | |
normalize l = map (\x -> x / (maximum normalized)) normalized | |
where normalized = map (\x -> (x - minimum l)) l | |
removeMax :: [Int] -> Int -> [Int] | |
removeMax ls mx = map (\x -> if x == mx then x - 1 else x) ls | |
increment :: [Int] -> Int -> [Int] | |
increment (a:b) 0 = (a + 1):b | |
increment (a:b) y = a:(increment b (y - 1)) |
module ZipList where | |
type ZipList a = ([a], [a]) | |
newList :: ZipList a | |
newList = ([], []) | |
moveLeft :: ZipList a -> ZipList a | |
moveLeft ((a:b), c) = (b, (a:c)) | |
moveLeft _ = error "Invalid operation" |
I hereby claim:
To claim this, I am signing this object:
id | title |
---|---|
tools |
The coolest tools |
brew install git
#/bin/sh | |
if [[ -x $GIT_TOKEN ]]; then | |
echo "you need to set GIT_TOKEN env variable" | |
exit 1 | |
fi | |
# Get all merge requests for search-team, we can't use gonuts here because for example SearchAPI is under search team | |
# but we still sometimes work at it. Filter the merge request for only those that have time spent != null. | |
curl https://gitlab.skypicker.com/api/v4/groups/search-team/merge_requests\?state\=all\&per_page\=100 --header "Private-Token: $GIT_TOKEN" -s \ |