rbenv, ruby-buildを更新
$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
function slowCall() { | |
var df = $q.defer(); | |
// 非同期処理を担当する関数を定義 | |
function fn() { | |
var msg = 'now : ' + new Date().getTime(); | |
alert('inside async function.'); | |
df.resolve(msg); | |
}; | |
$timeout(fn, 1000); | |
return df.promise; |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
import java.io.PrintWriter; | |
import java.io.Writer; | |
import java.util.List; | |
import org.slim3.controller.Controller; | |
import org.slim3.controller.Navigation; | |
import org.slim3.datastore.Datastore; | |
import org.slim3.repackaged.org.json.JSONObject; | |
import org.slim3.util.StringUtil; |
<source> | |
type tail | |
path /home/jacopen/minecraft/data/vanilla/logs/latest.log | |
format /^\[.*\]\s\[.*\]:\s(?<log>.*)$/ | |
time_format %d/%b/%Y:%H:%M:%S %z | |
tag minecraft.log | |
pos_file /var/log/td-agent/minecraft.pos | |
</source> | |
<match minecraft.log> |
input = "(apple banana) [()mellon orange {banana}] (apple apple {mellon orange})" | |
# split input text by (), {}, [] | |
re_matchers = [ /\(.*?\)/, /\{.*?\}/, /\[.*?\]/ ] | |
results = [] | |
re_matchers.each do |re| | |
results.concat(input.scan(re)) | |
end | |
# count target occurrence |
# ----- PROMPT ----- | |
## PROMPT | |
PROMPT=$'[%*] → ' | |
## RPROMPT | |
RPROMPT=$'`branch-status-check` %~' # %~はpwd | |
setopt prompt_subst #表示毎にPROMPTで設定されている文字列を評価する | |
# {{{ methods for RPROMPT | |
# fg[color]表記と$reset_colorを使いたい | |
# @see https://wiki.archlinux.org/index.php/zsh |
/** | |
* すしパーティを始めます。 | |
* 引数で与えられたメンバーの数だけ大将のお任せ寿司を用意するよ。 | |
*/ | |
public void startSushiParty(int numMember) { | |
List<Sushi> dishes = new ArrayList<Sushi>(); | |
for(int i=0; i < numMember; i++) { | |
Sushi sushi = new Sushi(); // 勝手にランダムな寿司が出来上がるものとする | |
dishes.add(sushi); | |
} |
for(int i=0; i < numMember; i++) { | |
Sushi sushi = new Sushi(); // 勝手にランダムな寿司が出来上がるものとする | |
dishes.add(sushi); | |
sushi = null; // ここでどうなる? | |
} |