Skip to content

Instantly share code, notes, and snippets.

View everpeace's full-sized avatar
🏠

Shingo Omura everpeace

🏠
View GitHub Profile
@everpeace
everpeace / show branch descriptions in "git branch"
Created February 4, 2013 04:05
oneliner for showing branch descriptions in "git branch". Branch descriptions can be set with "git branch --edit-descrption [branchname]".
git branch | sed 's/^ /_/' | awk '{desc=""; "git config branch."$2".description"|getline desc ; print $1" "$2" "desc}'|sed 's/^_/ /g'
@everpeace
everpeace / gitsshm
Created May 15, 2012 14:16
GIT_SSH manager for github.
#!/bin/bash
if [ -z $GITHUB_KEYS_DIR ]; then
GITHUB_KEYS_DIR="$HOME/github-keys"
fi
if [ -z $GITHUB_KEY_FILE_NAME ]; then
GITHUB_KEY_FILE_NAME="id_rsa"
fi
@everpeace
everpeace / 普通に表示させると。
Created April 24, 2012 13:55
git log --graph のコミットハッシュ値を全部相対表現で表示する
$ git log --graph --oneline
*-. 9010104 Merge branches 'master3' and 'master2'
|\ \
| | * dd0ba6d add b2
| * | 75a99a0 add b3
| |/
* | 743ad3b add b1
|/
* 81b919d add a
@everpeace
everpeace / README.md
Created March 27, 2012 08:39
Automata (DFA,NFA,εNFA) in Scala
@everpeace
everpeace / A.txt
Created March 15, 2012 15:13
Matrix Multiplication in Scalding.
1 2 3
1 2 3
1 2 3
@everpeace
everpeace / BiKleisli.scala
Created September 21, 2011 15:04
Bi-Kleiseli on Scala
package com.github.everpeace
import scalaz._
import Scalaz._
/**
* BiKleisli arrow
* W: comonad
* M: monad
*/
@everpeace
everpeace / dining_philosophers_ja.als
Created August 12, 2011 08:25
[Japanese Version]Deadlock Detection for Dining Philosophers Problem in Alloy
-- This can be executed by alloy4.2-rc.jar on http://alloy.mit.edu/community/node/1039
-- This version supports unicode identifiers.
open util/ordering[システム状態]
sig 哲学者 {
disj 左フォーク, 右フォーク: one フォーク,
左, 右: one 哲学者
}
sig フォーク {
disj 左, 右: one 哲学者
@everpeace
everpeace / dining-philosophers.als
Created August 7, 2011 03:48
Deadlock Detection for Dining Philosophers Problem in Alloy
open util/ordering[State]
-- 哲学者
sig Philosopher {
-- 左と右には異なる1本のフォークがある
disj leftFork, rightFork: one Fork,
-- 左と右には異なる哲学者が1人ずついる
left, right: one Philosopher
}
-- フォーク