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
| def execute(list: Seq[Int] ) = { | |
| for(data <- list) yield cRepository.findById(data) map { | |
| case Some(ca) => ca.status match { | |
| case Stopped => list filterNot (_ == ca.id.get) | |
| case _ => list | |
| } | |
| case None => list | |
| } | |
| Future.successful(list) | |
| } |
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 q = for { | |
| (user, pao) <- usrs.soft joinLeft paos.soft on (_.id === _.userId) | |
| (pao, pa) <- paos.soft join pas.soft on (_.paId === _.id) | |
| } yield (user, pao, pa) | |
| db.run(q.result) map { | |
| case Seq(data) => Seq(data._1.copy(pa = Some(data._3))) | |
| case _ => Seq() | |
| } |
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
| def testFunction(id: HogeId) = { | |
| for { | |
| hoge <- db.run(hoges.filter(_.id === id).result.headOption) | |
| hugas <- db.run(hugas.filter(_.hogeId === id).result) | |
| } yield (hoge, hugas) match { | |
| case (Some(account), fields) => { | |
| val test_val = fields map { pu => | |
| (pu.name, pu.alvue) | |
| } toMap; |
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
| [~] /usr/libexec/java_home -v 1.8.0 19:48:27 | |
| /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home | |
| [~] |
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
| $(document).on("submit", ".js-admin-edit-form", function(event) { | |
| //ifに引っかかったときの処理 | |
| if( $("#hoge-form").val("abc") ){ | |
| if($("#category").val() === "" || $("#genre").val() === "") { | |
| alert("カテゴリやジャンルが選択されていません"); | |
| return 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
| //var | |
| var example = 'some string'; | |
| //console.log | |
| console.log(example); | |
| //length | |
| console.log(example.length); | |
| //random number create |
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
| <html> | |
| <?php $week = array("日", "月", "火", "水", "木", "金", "土"); ?> | |
| <?php $w = date("w", strtotime($date)); ?> | |
| <?php if($w == 0): ?> | |
| <p><?php echo $date; ?><font color="#ff0000">(<?php echo $week[$w]; ?>)</p> | |
| <?php elseif($w == 6): ?> | |
| <p><?php echo $date; ?><font color="#0000ff">(<?php echo $week[$w]; ?>)</p> | |
| <?php else: ?> | |
| <p><?php echo $date; ?>(<?php echo $week[$w]; ?>)</p> |
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 | |
| /** | |
| ** 曜日を色付きで返す | |
| */ | |
| public static function getDayOfWeek($date){ | |
| $week = array("日", "月", "火", "水", "木", "金", "土"); | |
| $w = date("w", strtotime($date)); | |
| print($date); | |
| if($w == 0){ | |
| print("<FONT COLOR=\"RED\">(".$week[$w].")"); |
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
| <html> | |
| <head> | |
| <script src="build/react.js"></script> | |
| <script src="build/JSXTransformer.js"></script> | |
| </head> | |
| <body> | |
| <div id="container"></div> | |
| <script type="text/jsx"> | |
| var App = React.createClass({ | |
| render: function(){ |
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
| $ su | |
| $ yum install gcc gcc-c++ make git openssl-devel freetype-devel fontconfig-devel | |
| $ cd /usr/local/src/ | |
| $ wget https://phantomjs.googlecode.com/files/phantomjs-1.9.8-linux-x86_64.tar.bz2 | |
| $ tar jxfv phantomjs-1.9.8-linux-x86_64.tar.bz2 | |
| $ cp phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/bin/ |