This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## build vmware's kernel modules | |
## execute this if linux kernel is updated | |
$ sudo vmware-modconfig --console --install-all | |
## To upgrade it self, just donwload *.bundle | |
## and execute it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
=begin | |
## Haml | |
http://haml.info/docs/yardoc/frames.html#!http%3A//haml.info/docs/yardoc/ | |
http://haml.info/docs/yardoc/file.REFERENCE.html#options | |
=end | |
require 'haml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require 'nokogiri' | |
require 'active_support/core_ext' | |
module MakeBlankXML | |
class << self | |
def execute | |
org_doc = Nokogiri::XML(DAMMY_XML) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'date' | |
module DateTimeStringer | |
def to_sdate | |
strftime("%Y-%m-%d") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Integer | |
def prime? | |
!2.upto(self/2).any?{|i| n % i == 0 } | |
end | |
def prime_factors | |
return [1] if self == 1 | |
n = self | |
i = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require 'pathname' | |
require 'fileutils' | |
class Pathname | |
def basename_without_ext | |
Pathname(basename.to_s.gsub(/#{extname}$/, "")) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* PRE : ubuntu 12.04 distributed jwhois.conf | |
* POST: download from gnu prjct page, add the costomization for japanese servers | |
* > downloaded from : http://cvs.savannah.gnu.org/viewvc/*checkout*/jwhois/jwhois/example/jwhois.conf?revision=1.143 | |
* NOTE: Japanese encoding is "ISO-2022-JP" | |
--- jwhois.conf.bk 2010-11-25 00:39:15.000000000 +0900 | |
+++ jwhois.conf 2013-01-23 14:26:57.966240523 +0900 | |
@@ -17,6 +17,11 @@ | |
type = regex; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make empty element | |
echo '<hoge></hoge>\n' | sed -E 's/<([^>]+)>\s*\n*<\/\1>/<\1\/>/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
class PP | |
module PPMethods | |
def seplist(list, sep=nil, iter_method=:each) # :yield: element | |
sep ||= lambda { comma_breakable } | |
first = true | |
nest(1) { | |
breakable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Combine below files: | |
# https://github.com/github/gitignore/blob/master/Global/VisualStudio.gitignore | |
# https://github.com/github/gitignore/blob/master/CSharp.gitignore | |
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) | |
[Bb]in/ | |
[Oo]bj/ | |
# mstest test results | |
TestResults |