Skip to content

Instantly share code, notes, and snippets.

View kakkun61's full-sized avatar
🚂
Choo-choo

Kazuki Okamoto kakkun61

🚂
Choo-choo
View GitHub Profile
block_width = 10;
block_height = 4;
block_thickness = 1;
clay_width = 0.5;
clay_thickness = 0.5;
unit_width = block_width + 2 * clay_width;
unit_height = block_height + 2 * clay_width;
@kakkun61
kakkun61 / BUILD
Last active January 13, 2020 09:14
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "hello-time",
srcs = ["hello-time.cc"],
hdrs = ["hello-time.h"],
visibility = ["//visibility:public"],
)
module Main
( Version (Version)
, VersionRange (..)
) where
import Prelude
import Effect (Effect)
import Effect.Console (log)
import Node.FS.Sync
{
"word_count": 41810,
"processed_language": "ja",
"personality": [
{
"trait_id": "big5_openness",
"name": "知的好奇心",
"category": "personality",
"percentile": 0.8717131818384207,
"significant": true,
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NamedFieldPuns #-}
module Main where
import Network.Wreq
@kakkun61
kakkun61 / README.md
Created September 26, 2019 06:54
Install ThreadScope 0.2.11.1 on Windows

Edit stack.yaml

resolver: lts-12.26
extra-deps:
- ghc-events-0.8.0.2@sha256:3b591d15e8fab7426d9a9c2a0086872ee10232d78646d82705e0f2eea64df74c,4721

Install ThreadScope and dependencies

Some pacman packages may be redundant.

@kakkun61
kakkun61 / tmux_and_xsel.md
Last active May 21, 2019 02:43 — forked from pn11/tmux_and_xsel.md
リモートのtmuxのコピーモードとクリップボードを共有する

リモートのtmuxのコピーモードとクリップボードを共有する

  • ローカルマシン: Mac (iTerm2)
  • リモートマシン: Linux (ROOT権限なし)

という状況でtmuxのコピーモードでコピーしてきたものをMacで扱いたい。

C-b zでズームしてからoptionキー押しながらマウスでコピーでもいいんだけど(iTerm2のみ?、ズームしないと複数行コピーするときに隣のペインも選択してしまう)、キーボードだけでやりたい。そこでxselを使う。

@kakkun61
kakkun61 / ThreadPool.hs
Last active April 24, 2019 10:55
thread pool with thread-local state
module Control.Concurrent.ThreadPool
( Pool
, create
, queue
, state
, kill
) where
import Control.Concurrent (ThreadId, forkIO, killThread)
import Control.Concurrent.STM (TQueue, atomically, newTQueueIO,
@kakkun61
kakkun61 / Examples.md
Created March 22, 2019 12:35
C-like Syntax Alt-Haskell Plan
main :: IO ()
main = putStrLn "Hello, World!"
val main: IO<Unit> = putStrLn("Hello, World!")

@kakkun61
kakkun61 / Main.hs
Last active January 30, 2019 14:43
Ctrl-C with Haskell on Windows
import Control.Concurrent
import Control.Monad
import System.Exit
import System.IO
import System.Win32.Console.CtrlHandler
main :: IO ()
main = do
tid <- myThreadId
let