This file contains hidden or 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
| object Application extends Controller { | |
| implicit val charset = Codec.javaSupported("iso-8859-1") | |
| def index = Action { | |
| Ok(<h1>hello</h1>).as(HTML) | |
| } | |
| } |
This file contains hidden or 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
| module.exports = (time) -> | |
| elapse = | |
| if time instanceof Date | |
| time.getTime() - Date.now() | |
| else if typeof time == "number" | |
| time - Date.now() | |
| else | |
| console.warn "Given a invalid date type(\"#{typeof time}\") arguments. expected date type is Date or Number." | |
| "" | |
This file contains hidden or 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
| <?php | |
| preg_match('/^([[:alnum:]]*)([[:^alnum:]]*)$/u', 'aaaaああああ', $matches); | |
| if ($matches[0] === 'aaaaああああ') { | |
| echo 'MATCH!' | |
| } | |
| /* | |
| UTF8モードだとalnumでひらがながマッチする |
This file contains hidden or 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
| app.configuration.getBoolean("trustxforwarded").orElse(Some(false)) |
This file contains hidden or 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
| val (text, status) = args.headOption.collect { | |
| case "new" => newCommand _ | |
| case "help" => helpCommand _ | |
| }.map { command => | |
| command(args.drop(1)) | |
| }.getOrElse { | |
| (Colors.red("Error"), -1) | |
| } |
This file contains hidden or 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
| <?php | |
| $array = ['A', 'A', 'A', 'B', 'B', 'C', 'D']; | |
| function selectDuplicates($array) { | |
| $duplicate = array_filter(array_count_values($array), function($v) { | |
| return $v > 1; | |
| }); | |
| return array_keys($duplicate); | |
| } |
NewerOlder