Skip to content

Instantly share code, notes, and snippets.

View matsubara0507's full-sized avatar
:bowtie:
Working with Ruby

MATSUBARA Nobutada matsubara0507

:bowtie:
Working with Ruby
View GitHub Profile
main :: IO ()
main = putStrLn "World"
main :: IO ()
main = putStrLn "Hello"
main :: IO ()
main = putStrLn "Hello"
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"
# イスの過去のお題一覧
- 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 April 29, 2019 05:33
JSON with default value using Nullable
{-# 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 April 27, 2019 09:54
lift `Record xs` to `RecordOf h ys`
{-# 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 December 18, 2018 14:02
Elm 0.19 のライフゲーム(スマホ非対応バージョン)
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
@matsubara0507
matsubara0507 / 0-tpl.json
Last active December 30, 2021 17:15
My Outputs
{
"01": [],
"02": [],
"03": [],
"04": [],
"05": [],
"06": [],
"07": [],
"08": [],
"09": [],
@matsubara0507
matsubara0507 / md2hugo.rb
Created December 3, 2018 04:30
MD -> Hugo の frontmatter をたす
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?('# ')