Skip to content

Instantly share code, notes, and snippets.

View konn's full-sized avatar
🏠
Working from home

Hiromi Ishii konn

🏠
Working from home
View GitHub Profile
@konn
konn / moon.txt
Created January 31, 2018 12:37
Moon Songs
The Beatles "Mr. Moonlight" (The Beatles Super Best Collection)
Billie Holiday "Blue Moon" (Billie Holiday / The Great American Songbook)
Billie Holiday "If the Moon Turns Green" (Billie Holiday / The Great American Songbook)
Billie Holiday "What a Little Moonlight Can Do" (Billie Holiday / The Great American Songbook)
Billie Holiday "East of the Sun (West of the Moon)" (Billie Holiday / The Great American Songbook)
Billie Holiday "Moonglow" (Billie Holiday / The Great American Songbook)
Billy Eckstine "Moon River" (The Best Jazz On TV-CM)
Chet Baker "Polka Dots And Moonbeams" (Chet Baker cool jazz)
Clifford Brown "Blue Moon" (The Best Jazz On TV-CM)
Oscar Petrson "It's Only A Paper Moon" (The Best Jazz On TV-CM)
@konn
konn / type-level-prime-test.hs
Last active April 29, 2018 15:13
Type Level (extraordinarily) naive prime test
{-# LANGUAGE ConstraintKinds, DataKinds, FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances, GADTs, MultiParamTypeClasses, PolyKinds #-}
{-# LANGUAGE TypeFamilies, TypeInType, TypeOperators, UndecidableInstances #-}
module Lib where
import Data.Type.Equality
import GHC.Exts
import GHC.TypeLits
type Mod n p = Mod0 n p (n + 1 <=? p)
type family Mod0 n p b where
@konn
konn / README.md
Last active July 17, 2017 14:54
Automatic PDF synchronisation between local and cloud storage, which takes care of collision

Automatic PDF synchronisation between local and Cloud Storage

This hook scripts allows you to synchronise PDF files whenever you make a commit which changes PDF-file. If the PDF on Cloud Storage is changed since the commit made, this script asks whether proceed overwriting, backup-ing or just abort.

The intended use is to sync PDF between local and Digital Paper Device, where DPD-version might contain "hand-written" notes.

It is also useful, when you use the same directory to sync with Cloud storage and Digital Paper Device.

Requirements

  • Bash
@konn
konn / diff.mod
Last active March 16, 2017 15:24
Deeply embedded Automatic Differentiation in Lambda Prolog
module diff.
%% First attempt:
% Automatic differentiation, easy (i.e. non-composite) case.
% Lambda Prolog supports pattern-matching on lambdas,
% so we can use it to define "deep-embedded" autodiffs:
% We can exploit the higher-order expressiveness of Lambda Prolog
% to express that "F is a constant function".
ediff F (X : real\ 0.0) :- pi Y\ pi X\ F X = F 0.0, !.
@konn
konn / planning.hs
Last active October 4, 2016 22:07
Solving Work plan by SMT solver
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# LANGUAGE DeriveFoldable, GeneralizedNewtypeDeriving, OverloadedStrings #-}
{-# LANGUAGE RecordWildCards, TemplateHaskell #-}
module Main where
import Control.Arrow (second)
import Control.Lens hiding ((.>))
import Control.Monad
import qualified Data.Foldable as F
import Data.Function
import Data.List
@konn
konn / math-cambria-font.el
Created September 29, 2016 09:15
Font Setting for unicode maths
(require 'cl)
(require 'math-symbol-lists)
(defun group-sorted (lst)
(reduce
(lambda (x ys)
(progn
(if (and (caar ys) (= (caar ys) (+ 1 x)))
(cons (cons x (car ys)) (cdr ys))
(cons (list x) ys) )
))
\newcommand{\checked}[2][.5ex]{%
\mathord{%
\tikz[baseline,line cap=round] {%
\node[anchor=base,inner sep=0pt] (n) {\ensuremath{#2}};%
\coordinate (nw) at ($(n.north west)+(.3ex, {#1 + 1pt})$); %
\coordinate (ne) at ($(n.north east)+(-.3ex,{#1 + 1pt})$);%
\draw[very thin,fill,line cap=round] (nw) -- ($(nw)!.5!(ne) - (0, #1)$) -- (ne) -- ($(nw)!.5!(ne) - (0, #1 - .1ex)$) --cycle;}}}
@konn
konn / Logic.hs
Created May 22, 2016 20:11
First-Order Logic formulated using TypeInTypes of GHC 8.0.1
{-# LANGUAGE DataKinds, ExistentialQuantification, FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances, GADTs, IncoherentInstances, InstanceSigs #-}
{-# LANGUAGE MultiParamTypeClasses, PolyKinds, RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, TemplateHaskell #-}
{-# LANGUAGE TypeApplications, TypeFamilies, TypeInType, TypeOperators #-}
{-# LANGUAGE UndecidableInstances, UnicodeSyntax #-}
module Main where
import GHC.TypeLits
import Data.Kind
import Data.Singletons.Prelude
@konn
konn / evtsrc-revpxy.cabal
Created April 25, 2016 06:39
POST -> EventSource over Reverse Proxy in Haskell
name: evtsrc-revpxy
version: 0.1.0.0
synopsis: Simple project template from stack
description: Please see README.md
homepage: https://github.com/konn/evtsrc-revpxy#readme
license: BSD3
license-file: LICENSE
author: Hiromi ISHII
maintainer: konn.jinro _at_ gmail.com
copyright: 2015 (c) Hiromi ISHII
@konn
konn / math-alphabetic.bbx
Created February 10, 2016 12:55
AMSRefs-like bib style for BibLaTeX
\ProvidesFile{math-alphabetic.bbx}[2016/02/10 alphabetic biblatex bibliography style for mathematicians]
\RequireBibliographyStyle{alphabetic}
\RequireBibliographyStyle{math-standard}
\ExecuteBibliographyOptions{labelalpha,sorting=anyt}
\endinput