Skip to content

Instantly share code, notes, and snippets.

View mzp's full-sized avatar

Hiro Mizuno mzp

View GitHub Profile
@mzp
mzp / abc.xml
Created October 28, 2008 12:55
<Action3 minorVersion="16" majorVersion="46">
<constants>
<Constants>
<ints/>
<uints/>
<doubles/>
<strings>
<String2 value=""/>
<String2 value="Hello"/>
<String2 value="Hello,world!!"/>
@mzp
mzp / gist:27341
Created November 21, 2008 03:51
CrossFire for GM
// ==UserScript==
// @name opera focus imitation
// @namespace
// @description this script imitate focus on opera by shift + cursor key
// @include *
// ==/UserScript==
// 問題:位置取得の効率が悪すぎる
// 要素が重なっていると隣の要素として判定ができない
// iframe 内には入れない、または出れない
window.addEventListener('load',function(){
@mzp
mzp / dm-noconfirm.user.js
Created February 11, 2009 00:14
Disable confirm dialog at DokusyoMeter(http://book.akahoshitakuya.com/)
// ==UserScript==
// @name Dokusyo meter no confirm
// @namespace http://d.hatena.ne.jp/mzp/
// @description Disable dokusyo meter confirm
// @include http://book.akahoshitakuya.com/b/*
// ==/UserScript==
function del(){
return true;
}
function add(){
@mzp
mzp / toggle-scala.el
Created March 1, 2009 06:35
Toggle between test and implementation files for scala project by Maven2
;;; toggle-scala.el --- Toggle between test and implementation files.
;; Author: MIZUNO Hiroki<mzp.ppp_at_gmail.com>
;; Keywords: tools
;;; Usage:
;; Insert into your .emacs file the following line, (and eval it for
;; immediate usage:
;;
;; (require 'toggle-scala)
type 'a t = {
front: 'a list;
back : 'a list
}
exception Empty
let empty = {front = []; back = []}
let is_empty x = x = empty
@mzp
mzp / queue.ml
Created May 18, 2009 13:21
amortized queue for ocaml
type 'a t = {
front: 'a list;
back : 'a list
}
exception Empty
let empty = {front = []; back = []}
let is_empty x = x = empty
@mzp
mzp / parserMonad.ml
Created June 14, 2009 23:45
parserMonad for pa_monad.ml
(* ocamlc -pp 'camlp4orf pa_monad.cmo' parserMonad.ml *)
type ('a,'b) either = Left of 'a | Right of 'b
module Make
(T : sig
type ts
type error
end) : sig
type ts = T.ts
;; Copyright (C) 2009 mzp
;; Author: mzp <mzp@debian.clovernet.ne.jp>
;; Keywords:
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
(*
e = . |
e* |
e e |
( e ) |
c
*)
#load "dynlink.cma";;
#load "camlp4o.cma";;
@mzp
mzp / pa_field.ml
Created September 13, 2009 04:50
OCaml's record syntax extension
(*
pa_field.ml
To compile:
ocamlc -pp camlp4oof -g -I . -I +camlp4 -c pa_field.ml
To use:
ocamlc -pp 'camlp4o pa_field.cmo' example.ml
or
ocaml dynlink.cma camlp4o.cma pa_field.cmo