Skip to content

Instantly share code, notes, and snippets.

🎋
Tanabata

Kazuki Okamoto kakkun61

🎋
Tanabata
Block or report user

Report or block kakkun61

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

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

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

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

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

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

@kakkun61
kakkun61 / ThreadPool.hs
Last active Apr 24, 2019
thread pool with thread-local state
View ThreadPool.hs
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 Mar 22, 2019
C-like Syntax Alt-Haskell Plan
View Examples.md
main :: IO ()
main = putStrLn "Hello, World!"
val main: IO<Unit> = putStrLn("Hello, World!")

@kakkun61
kakkun61 / Main.hs
Last active Jan 30, 2019
Ctrl-C with Haskell on Windows
View Main.hs
import Control.Concurrent
import Control.Monad
import System.Exit
import System.IO
import System.Win32.Console.CtrlHandler
main :: IO ()
main = do
tid <- myThreadId
let
@kakkun61
kakkun61 / Main.hs
Last active Feb 13, 2018
Data Types A La Carte
View Main.hs
-- http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
main :: IO ()
View select-gcc
#!/usr/bin/env bash
set -e
GCC_PATH=/usr/local/bin/gcc
usage() {
echo "$(basename $0) [fsf/apple]" >&2
}
@kakkun61
kakkun61 / Main.hs
Last active Feb 4, 2018
手続き Haskell
View Main.hs
module Main where
import Prelude hiding (break)
import Control.Monad (when)
import Control.Monad.Cont (callCC, ContT, runContT)
import Control.Monad.IO.Class (liftIO)
import qualified Data.Foldable
import Data.IORef (newIORef, readIORef, writeIORef)
import qualified Data.Traversable
View pacman on msys through stack
λ stack exec pacman -- -S -y mingw64/mingw-w64-x86_64-zlib
λ stack exec pacman -- -Ql mingw-w64-x86_64-zlib
View mysql_config.c
#include<stdio.h>
#include<stdlib.h>
#define COMMAND_SIZE 256
int main(int argc, char **argv) {
char *mysql_config="C:\\Strawberry\\perl\\bin\\perl.exe /tools/mysql/current/bin/mysql_config.pl";
char command[COMMAND_SIZE];
if (argc == 0) {
@kakkun61
kakkun61 / README
Last active Apr 24, 2017
identifyForm bug when there are 2 form and one of them have no field (already fixed https://github.com/yesodweb/yesod/pull/1340)
View README
to write this later
You can’t perform that action at this time.