Skip to content

Instantly share code, notes, and snippets.

@kimoto
kimoto / normalize_neologd.rb
Last active August 29, 2015 14:17
Normalizer for mecab-neologd
require 'moji'
def normalize_neologd(norm)
norm.tr!("0-9A-Za-z", "0-9A-Za-z")
norm = Moji.han_to_zen(norm, Moji::HAN_KATA)
hypon_reg = /(?:˗|֊|‐|‑|‒|–|⁃|⁻|₋|−)/
norm.gsub!(hypon_reg, "-")
choon_reg = /(?:﹣|-|ー|—|―|─|━)/
norm.gsub!(choon_reg, "ー")
chil_reg = /(?:~|∼|∾|〜|〰|~)/
@kimoto
kimoto / csresulter2csv.rb
Created May 12, 2015 09:40
CSResulter to CSV
#!/bin/env ruby
# encoding: utf-8
require 'nokogiri'
require 'net/http'
MEMBER_KEY="メンバー"
DAY_KEY="日付"
def crawl(url)
doc = Nokogiri::HTML(Net::HTTP.get(URI(url)))
@kimoto
kimoto / elasticsearch144.rb
Created August 13, 2015 08:59
elasticsearch144.rb
class Elasticsearch14 < Formula
homepage "https://www.elastic.co/products/elasticsearch"
url "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz"
sha256 "a3158d474e68520664debaea304be22327fc7ee1f410e0bfd940747b413e8586"
bottle do
cellar :any
sha256 "d2a1df0938267bcff1cfae6341392ec2d4869809e7adf868e8b3d54eb0908481" => :yosemite
sha256 "1d18d3bf86a1b6e17a9612d0178e12f70a68fffd0eddd0c956964226d48ef3b0" => :mavericks
sha256 "f3bb1bfc49b1a56ddfa485c8c032d3b39beb70cf0ed9df20c69d3dbff8a2abd2" => :mountain_lion
@kimoto
kimoto / elasticsearch14.rb
Created August 13, 2015 09:00
elasticsearch14.rb
class Elasticsearch14 < Formula
homepage "https://www.elastic.co/products/elasticsearch"
url "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz"
sha256 "a3158d474e68520664debaea304be22327fc7ee1f410e0bfd940747b413e8586"
bottle do
cellar :any
sha256 "d2a1df0938267bcff1cfae6341392ec2d4869809e7adf868e8b3d54eb0908481" => :yosemite
sha256 "1d18d3bf86a1b6e17a9612d0178e12f70a68fffd0eddd0c956964226d48ef3b0" => :mavericks
sha256 "f3bb1bfc49b1a56ddfa485c8c032d3b39beb70cf0ed9df20c69d3dbff8a2abd2" => :mountain_lion
@kimoto
kimoto / fashion_press.rb
Created August 18, 2015 08:42
fashion press cralwer
#!/bin/env ruby
# encoding: utf-8
require 'net/http'
require 'nokogiri'
uri = URI("http://www.fashion-press.net/brands/en")
doc = Nokogiri::HTML(Net::HTTP.get(uri))
results = []
@kimoto
kimoto / syouhyou_yomi.rb
Created August 18, 2015 08:46
商標検索をもとに読みを取得する
#!/bin/env ruby
# encoding: utf-8
require 'mechanize'
def syouhyou_yomi(*keywords)
keywords.flatten!
wait_time = 0.2
agent = Mechanize.new
agent.user_agent_alias = 'Mac Mozilla'
//------------------------------------------------------
// textchat communication
// textchat.cfg
//------------------------------------------------------
// keyboard
bind "1" "say_team 1"
bind "2" "say_team 2"
bind "3" "say_team 3"
bind "4" "say_team 4"
bind "e" "say_team check this!; vocalize SmartLook"
#include <sourcemod>
#define PLUGIN_VERSION "1.0.0"
public Plugin:myinfo =
{
name = "cant say plugin",
author = "kimoto",
description = "cant use console command: say",
version = PLUGIN_VERSION,
url = ""
//
// Name: everywhere ghost respawn SourceMod plugin
// History:
// ver0.2:
// cleanup source code
// added debug mode
// added keyconfig
// ver0.1:
// first release
//
# name:
# auto-team-balance(all shuffle mode) concept code
# spec:
# spectators is need more +1 slot
# if under 2 player then not enable auto balanced function, why? should be server shutting down
# known bugs:
# *fixed: unbalance size teams so error
# history:
# bug fixed
# cleanup code