Skip to content

Instantly share code, notes, and snippets.

View p1xelHer0's full-sized avatar
🌱

pontus p1xelHer0

🌱
  • Stockholm
  • 18:05 (UTC +02:00)
View GitHub Profile
module ConstantInstance where
import Data.Monoid as M
newtype Constant a b = Constant
{ getConstant :: a
} deriving (Eq, Ord, Show)
instance Functor (Constant a) where
fmap f (Constant a) = Constant a
data Two a b =
Two a
b
deriving (Eq, Show)
instance (Semigroup a, Semigroup b) =>
Semigroup (Two a b) where
(Two x1 y1) <> (Two x2 y2) = Two (x1 M.<> x2) (y1 M.<> y2)
instance (Monoid a, Semigroup a, Monoid b, Semigroup b) =>
" I work on both Linux and macOS, so some settings differ on those system
function! g:IsMacOS()
if has('unix')
let s:uname = system('uname')
if s:uname ==? "Darwin\n"
return 1
else
return 0
endif
endif
//////
// -- basic react linting with prettier
// install the following
yarn add -D babel-eslint eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-react prettier eslint-plugin-import
//.eslintrc
# https://superuser.com/questions/270214/how-can-i-change-the-colors-of-my-xterm-using-ansi-escape-sequences
colortest() {
text='•‿•'
printf "base ";
for base in 00 01 02 03 04 05 06 07 08 09 '0A' '0B' '0C' '0D' '0E' '0F'; do
printf " ${base} ";
done
printf "\n";
for FG in 00 18 19 08 20 07 21 15 01 16 03 02 06 04 05 17; do
printf "\e[38;5;${FG}mcolor${FG}\e[0m ";