Skip to content

Instantly share code, notes, and snippets.

@poad
poad / .bashrc
Last active January 12, 2016 13:13
【メモ】Git for Windows + MinGWな環境の.bashrc ref: http://qiita.com/poad1010/items/d79a244e661b5d0e12c3
# less コマンド等のエラー回避
export TERM=msys
# lsで日本語を表示する
alias ls='ls --color=auto --show-control-chars'
alias ll='ls -l'
alias l='ls -CF'
# gettext用
export OUTPUT_CHARSET=UTF-8
@poad
poad / file0.java
Created May 24, 2014 18:39
Selenium2 WebDriverを使ってみる ref: http://qiita.com/poad1010/items/77512f4c629b5985c16b
package com.github.poad.example.selenium;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
@poad
poad / file0.txt
Last active May 6, 2017 13:18
Vagrant base boxをいちから手動で構築する ref: http://qiita.com/poad1010/items/98672357772350a470ec
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults\tenv_keep="SSH_AUTH_SOCK"' /etc/sudoers
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults:vagrant !requiretty' /etc/sudoers
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers
sudo sed -i -e '/%sudo\s\ALL=(ALL:ALL) ALL/a %vagrant ALL=(ALL) NOPASSWD: ALL' /etc/sudoers
@poad
poad / file0.txt
Created December 1, 2013 10:04
Ubuntu ServerへのVirtualBox Guest additionsインストール ref: http://qiita.com/poad1010/items/333198e9400802534a64
sudo apt-get install xserver-xorg xvfb
sudo mount /dev/cdrom /media/cdrom
cd /media/cdrom
sudo sh VBoxLinuxAdditions.run
// Option型(Optionモナド)を返す側
public class Configuration {
public Option<String> get(String key) {
final String value = System.getProperty(key);
if (value == null) {
return new None<String>();
} else {
return new Some<String>(value);
}
}
package learning.client.cassandra
import org.apache.cassandra.thrift.Cassandra
import org.apache.cassandra.thrift.Column
import org.apache.cassandra.thrift.ColumnParent
import org.apache.cassandra.thrift.ConsistencyLevel
import org.apache.thrift.protocol.TBinaryProtocol
import org.apache.thrift.transport.TFramedTransport
import org.apache.thrift.transport.TSocket
import java.nio.ByteBuffer
@poad
poad / 修正前
Created March 13, 2013 13:20
Java6でのリソースと例外処理 ref: http://qiita.com/items/4cb9b0791e2f882cefff
InputStream in = null;
try {
in = new FileInputStream("test.txt");
// stream操作
} catch (IOException e) {
// error処理
} finally {
try { // 必要に応じて
if (in != null) {
in.close();