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
Observable.just("[email protected]").flatMap(new Function<String, ObservableSource<String>>() { | |
@Override | |
public ObservableSource<String> apply(String s) throws Exception { | |
// return Observable.concat(validateEmail(s), validateNonNull(s)); | |
return Observable.zip(validateEmail(s), validateNonNull(s), new BiFunction<String, String, String>() { | |
@Override | |
public String apply(String s, String s2) throws Exception { |
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
Review review = Yummy.create(Review.class); | |
review.getComment(); //=> "lkjashldkjaspdiqwekjnd091824lknf09234kjhsf" | |
review.getId(); //=> 2 |
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
class String | |
def uzulla? | |
self == "うずら" | |
end | |
def udzura? | |
self == "うづら" | |
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
def hoge? | |
true | |
end | |
p hoge?.! #=> false | |
p !hoge? #=> false |
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 "text-table" | |
module AbstractController | |
module Callbacks | |
def process_action(*args) | |
run_callbacks(:process_action) do | |
super | |
end | |
table = Text::Table.new |
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
$("#new_form").formValidator.parameters({ | |
"user_email" : [["NotNull", "Email"]], # NotNull, Emailが並列で実行される | |
"user_email" : [["NotNull", "Email"], "Remote"], # NotNull, Emailが並列で実行されたあとにRemoteが実行される | |
"user_password": ["NotNull", "Password"] | |
}) | |
$.extend($.formValidator.errorMessages, { | |
"user_email" : "メールアドレスデフォルト", | |
"user_email.notnull" : "必須項目です", | |
"user_email.email" : "メールアドレスが不正です", |
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 peco-src() { | |
local selected_dir=$(ghq list --full-path | peco --query "$LBUFFER") | |
if [ -n "$selected_dir" ]; then | |
cd ${selected_dir} | |
fi | |
} | |
zle -N peco-src | |
bindkey '^S' peco-src |
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
use 5.10.1; | |
use strict; | |
use warnings; | |
use Benchmark qw(:all); | |
package Applyed { | |
use Mouse; | |
extends "Data::Validator"; | |
with "Data::Validator::Role::Croak"; | |
}; |
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
use strict; | |
use warnings; | |
use Benchmark qw(:all); | |
use Plack::Util (); | |
use Mouse::Util (); | |
use Class::Load (); | |
use Module::Load (); | |
sub load { | |
my($class, $prefix) = @_; |
NewerOlder