Skip to content

Instantly share code, notes, and snippets.

View tiqwab's full-sized avatar

Naohisa Murakami tiqwab

View GitHub Profile
# window の操作
bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
#
#
# # C-bのキーバインドを解除する
set-option -g prefix C-t
unbind-key C-b
@tiqwab
tiqwab / sais.go
Created September 17, 2018 10:06
Construct suffix array by SA-IS
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
"math"
)
@tiqwab
tiqwab / setupdb.sh
Created August 10, 2018 13:18
Simple script to setup mysql with Docker
#!/bin/sh
set -eu
docker container run -d -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=password \
--name scalacheck-mysql mysql:5.7
# Wait for setup
set +e
for i in $(seq 20)
@tiqwab
tiqwab / how-to-configure-keymap-in-windows.md
Last active June 11, 2018 14:11
How to configure key map in windows (CapsLock -> Ctrl and Ctrl-Space -> IME ON/OFF)
@tiqwab
tiqwab / StateMachineReaderCats.scala
Last active April 1, 2018 10:27
StateMachineReader with scalaz and cats
package example
object SampleMain {
import cats._
import cats.data._
import cats.instances.option._
type StateMachine = StateT[Option, Int, String]
@tiqwab
tiqwab / default.rb
Last active September 23, 2017 05:05
td-agent::default recipe
# The recipe to install td-agent3.
# This is tested only for Ubuntu 14.04 LTS.
# Install td-agent
# Should be td-agent3
# TODO: Avoid to execute `apt-get update` in the recipe?
execute 'install td-agent' do
command "curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent3.sh | sh"
action :run
end
@tiqwab
tiqwab / spring-initializer
Created April 7, 2017 12:03
Spring Initializer
curl https://start.spring.io/starter.tgz -d dependencies=web,security,lombok -d type=gradle-project -d groupId=com.tiqwab artifactId=boot-with-security packageName=com.tiqwab name=boot-with-security | tar -xzvf -
@tiqwab
tiqwab / Quote.hs
Created November 29, 2016 23:12
Refs of TemplateHaskell and QuasiQuotes
module HereDoc.Quote (
heredoc
)
where
import Data.Char
import qualified Language.Haskell.TH as TH
import Language.Haskell.TH.Quote
{-
# timing of visiting nodes
PRE = 1
IN = 0
POST = -1
'''
Implementation of splay tree
'''
class Node:
class Node:
def __init__(self, x, parent=None):
self.key = x
self.left = None
self.right = None
self.parent = parent
def append_child(self, child):
if self.key > child.key:
self.left = child