Skip to content

Instantly share code, notes, and snippets.

@connrs
connrs / Foundation.hs
Last active February 10, 2017 20:50
isSuperAdminCheck (Yesod Google Group question)
isAuthorized AssetR _ = isSuperAdmin
isAuthorized HomeR _ = isAuthenticated
-- | Are you logged in?
isAuthenticated :: Handler AuthResult
isAuthenticated =
do muid <- maybeAuthId
return $
case muid of
Nothing -> Unauthorized "You must login to access this page"
@connrs
connrs / LICENSE.md
Last active May 7, 2018 19:32
mkcarpet - bash script to create a carpet .jar file

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@connrs
connrs / find.sh
Created December 23, 2018 19:14
Random find with imagemagick shit
find . -type f -iname '*.jpg' | while IFS= read -r f; do
_format=$(identify -format '%m' "$f");
if [[ $_format == "JPEG" ]]; then
echo 'File: '$f
ls -lh "$f" | awk '{print $5}'
mogrify -quality 78 "$f"
ls -lh "$f" | awk '{print $5}'
exit 0
fi
#echo "$f|"$(identify -format '%m' "$f");