Skip to content

Instantly share code, notes, and snippets.

View satomikko94's full-sized avatar

Satomi Moriki satomikko94

View GitHub Profile
@satomikko94
satomikko94 / Application.java
Last active December 13, 2015 05:33
PlayFrameworkでキャッシュの値の有無によってViewを出し分けするサンプル ref: http://qiita.com/satomikko94/items/c46be49f8833a03339e1
static Form<Task> taskFrom = Form.form(Task.class);
public Result index() {
return ok(setCache.render(taskFrom));
}
public Result setTask() {
// get values from form
Form<Task> filledForm = taskFrom.bindFromRequest();
Task task = filledForm.get();
@satomikko94
satomikko94 / file0.swift
Created August 24, 2014 19:57
SwiftでUILabelにHTMLを表示する方法 ref: http://qiita.com/satomikko94/items/31ce11a7b525552d4742
var htmlText = "空は<font color=\"blue\">青い</font>。<br>" +
"An apple is <font color=\"red\">red</font>."
var err:NSError?
self.htmlLabel.attributedText = NSAttributedString(
data: htmlText.dataUsingEncoding(NSUnicodeStringEncoding, allowLossyConversion: true),
options: [NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType],
documentAttributes: nil,
error: &err)
self.htmlLabel.font = UIFont(name: "System", size: 14)
@satomikko94
satomikko94 / .bash_profile
Created June 29, 2014 13:47
.bash_profile
if [ -f ~/.bashrc ] ; then
. ~/.bashrc
fi
@satomikko94
satomikko94 / .bashrc
Last active August 29, 2015 14:03
.bashrc
PATH=$PATH:/Applications/ADT/sdk/platform-tools
PS1="\[\033[0;35m\][\u@\h \W/ \t]\[\e[00m\]\$ "