Skip to content

Instantly share code, notes, and snippets.

@coord-e
coord-e / imelike.sh
Last active January 16, 2019 12:22
IMEをインストールしたくないんじゃあ
uconv -x hiragana | xargs -I{} curl -s 'http://www.google.com/transliterate?langpair=ja-Hira|ja&text={}' | jq -r '[.[][1][0]] | join("")'

Keybase proof

I hereby claim:

  • I am coord-e on github.
  • I am coorde (https://keybase.io/coorde) on keybase.
  • I have a public key whose fingerprint is 08FB 6C8F 0FC9 A3F8 298E 407E 2538 9604 EFCF EC3C

To claim this, I am signing this object:

class Num a {
zero :: a
sub :: a -> a -> a,
neg :: a -> a = sub zero,
} in
instance (Num Int) {
zero = 0,
sub = sub_int,
neg = neg_int,
} in
@coord-e
coord-e / Makefile
Created October 30, 2019 09:46
Makefile for satysfi
IMAGE_NAME := amutake/satysfi:nightly
DIST_DIR := dist
SUDO := sudo
DOCKER := $(SUDO) docker
DOCKER_RUN := $(DOCKER) run --rm -v $(CURDIR):/satysfi $(IMAGE_NAME)
MAIN := main
SOURCES := $(MAIN).saty Makefile $(shell find sections/ -name '*.saty')
@coord-e
coord-e / haskell_shellgei_1.sh
Last active February 2, 2020 04:54
moduleのexport listが省略されていないかチェック(Haskell)
git ls-files | grep '.hs' | grep -v -e '/Main.hs' | xargs -I% bash -c "cat % | grep where -n | head -n 1 | awk -F':' '{print \$1}' | xargs -I{} sed -n '1,{}p' % | grep -q '(' || echo %"
@coord-e
coord-e / haskell_shellgei_2.sh
Created February 2, 2020 05:07
モジュール名をパスに合わせる(Haskell)
for file in $(find . -name '*.hs' | grep src/); do sed -i 's/^module .*$/module '$(sed -e 's/.*src\/\(.*\)\.hs/\1/g' <<< "$file" | tr '/' '.')'/' $file; done

ラーメン

  • 志恩
  • 鶏々
  • むじゃき
    • 美味しかった
  • 清六屋
    • 味の評判はそんなによくないらしい?
      • が、ファンもいるらしい
  • 遅くまでやっている
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
import Data.Functor ( void )
import Data.Vector ( Vector, (!?), fromList )
import qualified Data.Map.Strict as Map ( Map, lookup, insert, empty )
import Control.Monad ( forever, unless )
import Control.Monad.State.Strict ( MonadState, modify, get, put, evalStateT )
@coord-e
coord-e / assoc.hs
Created July 15, 2020 01:15
Prove type-level list's associativity (using singletons)
#!/usr/bin/env stack
-- stack --resolver lts-16.5 script --package singletons
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}