Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echo -n !
exec git "$@"
class Stone
@@STONE_COLORS = [:white, :black]
def initialize(heads_color)
raise "Invalid type" unless @@STONE_COLORS.include?(heads_color)
@heads = heads_color
end
attr_reader :heads # 表の色
@hitode909
hitode909 / pi.c
Created February 20, 2009 08:20 — forked from cocontusfine/pi.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_NUM 999999999
typedef struct{
double ax;
double ay;
@hitode909
hitode909 / tf.rb
Created May 3, 2010 12:57 — forked from udonchan/tf.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'MeCab'
require 'uri'
require 'open-uri'
require 'generator'
require 'extractcontent.rb'
$KCODE='u'
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'uri'
require 'open-uri'
class Results
@l = nil
@cache = nil
#!ruby
require 'rubygems'
require 'twitter'
require 'pit'
def enjoy(&block)
begin
block.call
@hitode909
hitode909 / autoghiblize.user.js
Created July 18, 2010 02:51
tilyさんのforkして,twitterにポストするようにした
// ==UserScript==
// @name AutoGhiblize
// @namespace http://d.hatena.ne.jp/tily
// @include http://faithrm-zero-zero.blog.so-net.ne.jp/archive/*
// @require http://www.chasen.org/~taku/software/TinySegmenter/tiny_segmenter-0.1.js
// ==/UserScript==
//----[Markov]---------------------------------------
var Markov = function() {
this.chain = {}
@hitode909
hitode909 / kindai_crop_test.c
Created November 6, 2010 06:34 — forked from ultraist/kindai_crop_test.c
近デジ3:4でトリミング
/* 近代デジタルの画像をページ分割するヤツ(page_split)
   opencvを使う.
*/
#if 0
#include <cv.h>
#include <highgui.h>
#include <math.h>
#else
#include <opencv/cv.h>
#include <opencv/highgui.h>
# -*- coding: utf-8 -*-
$KCODE = 'UTF-8'
require 'rubygems'
require 'json'
require 'ya2yaml'
require 'oauth/cli/twitter' # gem install oauth-cli-twitter
BANNER = "usage ruby twitter_get_all_statuses.rb username path/to/file"
# TODO: 今何発言とったか表示できるようにする
@hitode909
hitode909 / olm.rb
Created October 22, 2011 01:31 — forked from nanki/olm.rb
One liner music player for Ruby. http://hitode909.appspot.com/one-liner-music/
require 'rubygems'
require 'ffi-portaudio'
def safe
r = nil
Thread.new {
$SAFE = 4
r = yield
}.join
r