Skip to content

Instantly share code, notes, and snippets.

View gigawhitlocks's full-sized avatar
🐄
la misma vaca

Ian Whitlock gigawhitlocks

🐄
la misma vaca
View GitHub Profile
#!/bin/sh
# Snarf a file or the output of a command into the
# X11 paste buffer using xclip(1).
if [ -z $1 ]; then
name=`basename $0`
echo "Usage: $name [command] <arg1> ... <argN>, or"
echo " $name [file]"
exit 1
fi
show2d [x] = show x
show2d (x:xs) = show x ++ "\n" ++ show2d xs
multiples :: Integer -> [[Integer]]
multiples x = filter ((1 /=).(length)) $
map (\y->filter ((0 ==).(`mod` y)) [1 .. x]) [1..x]