Skip to content

Instantly share code, notes, and snippets.

View gongo's full-sized avatar
🍕
Thanks Driven Development

Wataru MIYAGUNI gongo

🍕
Thanks Driven Development
View GitHub Profile
key.setGlobalKey(['C-x', '.'], function () {
gBrowser.selectedTab.focus();
content.focus();
}, 'BODYへフォーカス', true);
# -*- coding: utf-8 -*-
require 'open-uri'
require 'kconv'
#
#= SKK の人名辞書ファイルから架空の氏名を生成する (Ruby version)
#
# Authors:: 宮國 渡
# Copyright:: Copyright (c) 2009 Wataru MIYAGUNI <gonngo@gmail.com>
# URL:: http://github.com/gongo
# -*- coding: utf-8 -*-
require 'open-uri'
require 'kconv'
#= ∀ガンダムのセリフをキャラ毎に抽出する
#
# Authors:: 宮國 渡
# Copyright:: Copyright (c) 2009 Wataru MIYAGUNI <gonngo@gmail.com>
# URL:: http://github.com/gongo
#
@gongo
gongo / parse_volume.rb
Created November 6, 2009 11:50
カンマ(,)による複数、及びハイフン(-)による連続した数字の取得
#!/usr/bin/env ruby
unless ARGV[0]
puts <<EOS
Usage:
ruby parse_volume.rb NUM
Example:
./parse_volume 12-15,19,23-29
#=> 12 13 14 15 19 23 24 25 26 27 28 29
@gongo
gongo / loto6.c
Created November 8, 2009 14:15
ロト6の番号をランダムに生成する (via http://gist.github.com/226929)
#include <stdio.h>
#include <stdlib.h>
(*ret)(int);
void *env;
__code
print(int *numbers)
{
# -*- coding: utf-8 -*-
#
#= AvtiveRecord::Base#update_or_create
#
# この拡張では、ActiveRecord::Base の update_attributes と create を
# 同時に行うことが可能となります。
#
#== 参考
#
# find_or_create
@gongo
gongo / increment-string-as-number.el
Created November 27, 2009 13:58
バッファ内で、カーソルの位置にある数字列をインクリメント(もしくは引数に指定した数字を加算)する
(defun increment-string-as-number (number)
"Replace progression string of the position of the cursor
by string that added NUMBER.
Interactively, NUMBER is the prefix arg.
examle:
At the cursor string \"12\"
M-x increment-string-as-number ;; replaced by \"13\"
C-u 10 M-x increment-string-as-number ;; replaced by \"22\"
@gongo
gongo / railroad-0.5.0-on-rails.2.3.patch
Created November 27, 2009 15:18
Railroad 0.5.0 で Rails のバージョンアップで、application.rb が無くなった(application_controller.rb になった)用のパッチ
*** controllers_diagram.rb.orig 2009-11-28 00:10:47.000000000 +0900
--- controllers_diagram.rb 2009-11-28 00:13:13.000000000 +0900
***************
*** 20,26 ****
STDERR.print "Generating controllers diagram\n" if @options.verbose
files = Dir.glob("app/controllers/**/*_controller.rb") - @options.exclude
- files << 'app/controllers/application.rb'
files.each do |f|
class_name = extract_class_name(f)
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'open-uri'
require 'nokogiri'
# http://subeki.akahoshitakuya.com/
class Subeki
def initialize
@base_uri = 'http://subeki.akahoshitakuya.com/n/'

ラー油の作り方

材料

材料量、大きさ
 ベース油(食用油を模索中、ごま油がベター)欲しい量
 白ネギ(の青い部分)適量
 ニンニク適量
 唐辛子適量
 容器ベース油が入る容積をもった容器