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 -*- | |
module ArrayToTempfile | |
require 'tempfile' | |
def write_array_to_tempfile(basename, array) | |
@tempfile = Tempfile.new(basename) | |
array.each do |line| | |
@tempfile.puts(line) |
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 -*- | |
module FileWriter | |
LINEFEED_CODE_LF = "\n" | |
def write(path, content, linefeed_code = nil) | |
file = File.open(path, "w") | |
content.each do |line| | |
if linefeed_code == nil |
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 -*- | |
module FileReader | |
DELETE_LINEFEED_CODE = true | |
KEEP_LINEFEED_CODE = !DELETE_LINEFEED_CODE | |
def read(path, delete_linefeed_code = true) | |
content = Array.new | |
File.open(path, "r") do |file| |
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 -*- | |
module MarkDownParser | |
require 'redcarpet' | |
def parse_with_redcarpet(str) | |
return Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(str) | |
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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-antrun-plugin</artifactId> | |
<version>1.7</version> | |
<executions> | |
<execution> | |
<id>gen-dir</id> | |
<phase>validate</phase> |
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
<!-- ボタンを設置したい場所に次を埋め込む --> | |
<ul id="social_buttons"> | |
<li class="tweet"></li> <!-- twitter --> | |
<li class="evernote"></li> <!-- Evernote --> | |
<li class="facebook_like"></li> <!-- Facebook --> | |
<li class="hatena"></li> <!-- はてなブックマーク --> | |
<li > <!-- Pocket --> | |
<a data-pocket-label="pocket" data-pocket-count="horizontal" class="pocket-btn" data-lang="en"></a> | |
<script type="text/javascript">!function(d,i){if(!d.getElementById(i)){var j=d.createElement("script");j.id=i;j.src="https://widgets.getpocket.com/v1/j/btn.js?v=1";var w=d.getElementById(i);d.body.appendChild(j);}}(document,"pocket-btn-js");</script> | |
</li> |
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
/** | |
* Google Analytics へのトラッキングを行うクラス。 | |
* | |
* @author tomoyamkung | |
* | |
*/ | |
public class GoogleAnalyticsTrack { | |
private Tracker tracker; |
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 オブジェクトとそのオブジェクトが表す実ファイルを作成する。 | |
* | |
* @param parent ファイルを作成するディレクトリ | |
* @param fileName ファイル名 | |
* @return 作成したファイルオブジェクト | |
* @throws IOException ファイルの作成に失敗した場合 | |
*/ | |
public static File create(File parent, String fileName) throws IOException { | |
File file = new File(parent, fileName); |
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
/** | |
* ディレクトリを作成する。 | |
* | |
* @param 作成するディレクトリのパス | |
* @throws IOException | |
*/ | |
public static File createDirectory(String path) throws IOException { | |
File dir = new File(path); | |
if(!dir.exists()) { | |
FileUtils.forceMkdir(dir); |
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
/* (non-Javadoc) | |
* @see android.app.Activity#onCreate(android.os.Bundle) | |
*/ | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// : | |
// : | |
WebView webView1 = (WebView)findViewById(R.id.webView1); |