Skip to content

Instantly share code, notes, and snippets.

{-
Waifu2x.hs by @notae_c based on https://github.com/WL-Amigo/waifu2x-converter-cpp/blob/master/appendix/waifu2x-commented.py
MIT license, see https://github.com/nagadomi/waifu2x/blob/master/LICENSE
-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
@notae
notae / osx_notify.hs
Last active February 24, 2016 15:30
Notify results of "stack build --file-watch" on OSX
#!/usr/bin/env stack
-- stack --resolver lts-4.0 --install-ghc runghc
module Main where
import Control.Monad (forM_, when)
import Data.List (isInfixOf)
import GHC.IO.Exception (ExitCode (..))
import System.Process (readProcessWithExitCode)
@notae
notae / MatrixProd2.hs
Last active October 30, 2016 14:46
https://gist.github.com/notogawa/1eb31c647bf230dbaebd88283a8b1699 を GHC 7.10 で動くよう変更。元コードの意図をちゃんと汲めてないかも・・
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module MatrixProd2 where
import Data.Proxy
@notae
notae / mydocker
Created November 24, 2017 02:04
Personalization of an existing docker image
#!/bin/bash
IMAGE=local/ubuntu-dev:16.04
NAME=mydocker
LANG=C.UTF-8
DIR=`dirname $0`
SETUP=mydocker-setup
SETUP_CMD=/root/${SETUP}
HOST_UID=`id -u`
HOST_GID=`id -g`
@notae
notae / GenericIso.hs
Created June 8, 2018 09:33
Convert between isomorphic types with GHC.Generics
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module GenericIso