Valid Table Style for markdown:
alias_name | command |
---|---|
st | status |
co | checkout |
cm | commit |
br | branch |
#!/usr/bin/env ruby | |
=begin | |
TODO: | |
* show the plugin name and its description. It could retrieve | |
from [INFO] section(XML) in the js file. | |
* suspicious english | |
=end | |
require 'pathname' |
=begin | |
[Ruby内で重複する値を抽出する方法](http://d.hatena.ne.jp/kiyo560808/20110801/1312196444) | |
``` | |
$ ruby -v | |
> ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] | |
user system total real | |
overlaps : [1, 2, 3, 4, 5, 2000] | |
1.850000 0.010000 1.860000 ( 1.866822) |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'redcarpet' | |
require 'pygments.rb' | |
class HTMLwithPygments < Redcarpet::Render::HTML | |
def block_code(code, language) | |
Pygments.highlight(code, :lexer => language.to_sym, :options => { | |
:encoding => 'utf-8' | |
}) |
#REF: http://d.hatena.ne.jp/oppara/20101116/p1 | |
# .git/configの編集はしないver. | |
# | |
# 1. .gitmodulesから該当行を削除 | |
# 2. cacheをrm | |
git rm --cached path/to/hoge | |
git commit | |
# 3. init |
#!/usr/bin/env ruby | |
# coding:utf-8 | |
# = Summary: | |
# | |
# Set#classify Example. | |
# | |
# Returns Hash instance whose key is date, and value is the set object | |
# consist from date instances within from date_range's first date to | |
# date_range's last date. |
#!/usr/bin/env ruby | |
# coding: utf-8 | |
# Please set the authentication | |
# information here to send the mail. | |
# | |
# * address : mail sending server name. | |
# * prot : mail sending server's port number. | |
# * user_name : auth user name to send mail. | |
# * password : auth passwd of user_name. |
#include <stdio.h> | |
void main(void) { | |
int i; | |
double x; | |
char buff[256]; | |
x = 1.15; | |
sprintf(buff, "1. sprintf(%f) => %.1E", x, x); | |
puts(buff); |
class String | |
def byte_num(index=0) | |
bytes.to_a[index] | |
end | |
end | |
def excoltoNum(str) # :nodoc: | |
return 0 if str.empty? | |
raise ArgumentError.new("string includes invalid charactor as column name") unless str =~ /^[a-zA-Z]+$/ |
# dot swings... | |
STDOUT.sync = true | |
print "Take a rest for about 10s ... zzz ..." | |
sleep(1) | |
3.times do | |
print "\033[2D\033[0K" | |
sleep(1) | |
print "." | |
sleep(1) |