Skip to content

Instantly share code, notes, and snippets.

Avatar
:bowtie:
Working with Ruby

MATSUBARA Nobutada matsubara0507

:bowtie:
Working with Ruby
View GitHub Profile
View sample.hs
main :: IO ()
main = putStrLn "Hello"
View ski.hs
import Data.String.Utils (replace)
import Data.Char (isDigit)
data CLTerm = Var String
| I
| K
| S
| Cons CLTerm CLTerm
instance Show CLTerm where
show I = "I"
View gist:72326e613ac8967f71ed43e8e1521949
# イスの過去のお題一覧
- 1予選「」
- 1本選「」
- 2予選「」
- 2本選「」
- 3予選「GitHub Gist のようなもの」 http://isucon.net/archives/32951806.html
- 3本選「」
- 4予選「いすこん銀行」 http://isucon.net/archives/40724693.html
- 4本選「動画広告配信」 http://isucon.net/archives/41634734.html
@matsubara0507
matsubara0507 / DefaultJson.hs
Created Apr 29, 2019
JSON with default value using Nullable
View DefaultJson.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
module DefaultJson where
import Data.Aeson
import Data.Extensible
import Data.Maybe (fromMaybe)
@matsubara0507
matsubara0507 / PolyPersonParams.hs
Last active Apr 27, 2019
lift `Record xs` to `RecordOf h ys`
View PolyPersonParams.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@matsubara0507
matsubara0507 / lifgame.elm
Created Dec 18, 2018
Elm 0.19 のライフゲーム(スマホ非対応バージョン)
View lifgame.elm
module Main exposing (main)
import Browser exposing (Document)
import Browser.Navigation exposing (Key)
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
import Html.Events.Extra.Pointer as Pointer
import Html.Attributes exposing (style, src)
import Array exposing (Array)
import SingleSlider
View 0-tpl.json
{
"01": [],
"02": [],
"03": [],
"04": [],
"05": [],
"06": [],
"07": [],
"08": [],
"09": [],
@matsubara0507
matsubara0507 / md2hugo.rb
Created Dec 3, 2018
MD -> Hugo の frontmatter をたす
View md2hugo.rb
path = ENV['path']
files = `ls -d #{path}/*`.split("\n")
p files
files.each do |filepath|
cont = File.read(filepath)
title, body = cont.split("\n", 2)
next unless title.start_with?('# ')