Skip to content

Instantly share code, notes, and snippets.

View mitsuse's full-sized avatar
💭
🐈🐈

mitsuse mitsuse

💭
🐈🐈
View GitHub Profile
@mitsuse
mitsuse / Tree.scala
Last active December 19, 2015 22:28
import scala.util.parsing.combinator._
class Tree[L](val label: L, val children: Seq[Tree[L]]) extends Traversable[Tree[L]] {
val numOfChildren = children.length
def this(label: L) = this(label, Seq[Tree[L]]())
override def toString: String = {
if (isTerminal) {
return label.toString
" Vim color file
" Name: h2u_black
" Maintainer: Kyo Nagashima <kyo@hail2u.net>
" URL: http://hail2u.net/
" Version: 12.4.21
" License: http://hail2u.mit-license.org/2010
set background=dark
@mitsuse
mitsuse / watchtexmake.py
Created December 5, 2013 11:35
A script to compile a document with LaTeX automatically
#!/usr/bin/env python
# coding: utf-8
def main(args):
import subprocess
pattern = '*.tex;*.bib;*.sty;'
command = 'make'
subprocess.call(
('watchmedo', 'shell-command', '-w', '-p',
pattern, '-c', command, args.work_directory))
@mitsuse
mitsuse / tex.dict
Created December 19, 2013 22:43
This is a TeX command dict extracted from Wikibooks. Neocomplete can use this file for dictionary-based completion.
/
\@
\\
\,
\;
\:
\!
\-
\=
\&gt;
@mitsuse
mitsuse / number.go
Created July 4, 2014 15:06
An interface named "Number" accepts numeric types such as "Int", "Float" and so on.
package main
import "fmt"
type Number interface {
Add(x Number) Number
Sub(x Number) Number
}
type Int int
@mitsuse
mitsuse / base-complete
Created September 13, 2014 22:00
A template for neocomplete source
let s:source = {
\ 'name': '{{_name_}}',
\ 'mark': '[{{_name_}}]',
\}
function! s:source.gather_candidates(context)
return []
endfunction
function! neocomplete#sources#{{_name_}}#define()
@mitsuse
mitsuse / kyushu.vim
Created September 14, 2014 11:10
A neocomplete source for people who live in Kyushu.
let s:source = {
\ 'name': 'kyushu',
\}
function! s:source.gather_candidates(context)
let l:candSeq = [
\ 'Fukuoka',
\ 'Saga',
\ 'Nagasaki',
\ 'Oita',
@mitsuse
mitsuse / coverage.bash
Created January 7, 2015 03:38
Shell scripts to calculate test coverage in Golang
#!/bin/bash
base_package=github.com/user_name/repo_name
base_path=${GOPATH}/src/${base_package}
package_list=(
${base_package}
)
if [ ! -d ${base_path}/coverprofile ]
@mitsuse
mitsuse / dissim.go
Created January 22, 2015 13:44
Calculate dissimlarities between the source image and target images.
package main
import (
"fmt"
"image"
"image/png"
"os"
"github.com/codegangsta/cli"
"github.com/mitsuse/mitsuse-go/image/similarity"
@mitsuse
mitsuse / main.go
Created February 19, 2015 01:12
An example of command-line tool implemented in Golang with codegangsta/cli.
package main
import (
"fmt"
"os"
"github.com/codegangsta/cli"
)
func main() {