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
File.open(FILE_PATH){|f| | |
f.each_line do |line| | |
puts(line) | |
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
#!/bin/sh | |
for ZIP in `ls *.zip` | |
do | |
unzip ${ZIP} >/dev/null 2>&1 | |
rm ${ZIP} | |
done |
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
function onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var menuEntries = [ | |
{name: "now", functionName: "writeNow"} | |
]; | |
ss.addMenu("Write Date", menuEntries); | |
} | |
function writeNow() { | |
var currentSheet = SpreadsheetApp.getActiveSheet(); |
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
## Ruby スクリプトの拡張子を "yaml" にした YAML が、スクリプトと同じディレクトリに存在する場合の例 | |
## - Ruby スクリプト:hoge.rb | |
## - YAML:hoge.yaml | |
#! ruby | |
#-*- encoding: utf-8 -*- | |
require 'yaml' | |
class Hoge |
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
## どうも忘れっぽくてダメだ | |
$ tar cvzf DIR_NAME.`date +%Y%m%d`.tar.gz DIR_NAME # => DIR_NAME.20120720.tar.gz |
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
#! ruby | |
#-*- encoding: utf-8 -*- | |
require 'yaml' | |
class Calculator | |
def initialize(exec_file) | |
@yaml = YAML.load_file(get_yaml(exec_file)) | |
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
require 'nkf' | |
string_utf8 = NKF.nkf('-w', string) |
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
#!/bin/sh | |
if [ ! -d $1 ]; then | |
echo "$1 は存在しないディレクトリです" | |
exit 1 | |
fi | |
### 次のようにすれば web ディレクトリに指定のディレクトリが存在するか、を確認できる | |
#!/bin/sh |
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
#! ruby | |
#-*- encoding: utf-8 -*- | |
class Hoge | |
def initialize | |
end | |
def execute | |
end | |
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
#! ruby | |
#-*- encoding: utf-8 -*- | |
require 'yaml' | |
class AddArray | |
def initialize(path) | |
@path = path | |
end |
OlderNewer