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
require "time" | |
require 'active_support/all' | |
require 'rest-client' | |
require 'json' | |
def get_logs(start_time, end_time) | |
response = RestClient.get "https://api:key-***********"\ | |
"@api.mailgun.net/v3/influencerone.jp/events", | |
:params => { | |
:'begin' => "#{start_time}", |
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
{ | |
"template": "elb_access_log*", | |
"mappings" : { | |
"elb_access_log" : { | |
"properties" : { | |
"backend" : { | |
"type" : "ip" | |
}, | |
"backend_port" : { | |
"type" : "integer", |
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
package main | |
import ( | |
"fmt" | |
mailgun "github.com/mailgun/mailgun-go" | |
) | |
func main() { | |
mg := mailgun.NewMailgun( |
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
Dear Customer, | |
Our systems have identified a potential hardware issue that may affect your | |
Amazon Redshift cluster {your_cluster_name} the {your_region_name} AWS region. | |
As a precaution, we recommend that you restore a new cluster from a snapshot | |
within the next 2-3 days and delete your existing cluster. | |
This will automatically provision you on healthy hardware and help you | |
avoid an unplanned outage. Please confirm receipt of this message. |
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
//split | |
val url = "https://play.google.com/store/apps/details?id=com.expedia.bookings&hl=ja" //sample_url | |
val replacedUrl = url.replace("https://", "") | |
val splitUrl =replacedUrl.split("/") | |
println(replacedUrl) //play.google.com/store/apps/details?id=com.expedia.bookings&hl=ja | |
println(splitUrl(0)) //play.google.com | |
//pattern match | |
splitUrl(0) match { | |
case "itunes.apple.com" => |
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
##例外処理 | |
scala> val n = try{"99".toInt} catch {case e:Exception => -99} | |
n: Int = 99 | |
scala> val n = try{"999".toInt} catch {case e:Exception => -99} | |
n: Int = 999 | |
scala> val n = try{ "momo".toInt } catch { case e:Exception => -99 } | |
n: Int = -99 |
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 sendEmail = Action.async { implicit request => | |
emailAddressForm.bindFromRequest.fold( | |
error => { | |
Future.successful(BadRequest("Your Aoolication")) | |
}, | |
emailAddress => { | |
//mail transfer process | |
val email = Email( | |
"Simple email", | |
"title <[email protected]>", |
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 = function() { | |
$(function() { | |
var num = 0 | |
$('#add-birthday-setting').on('click', function() { | |
num = parseInt($("#birthday-table tbody tr:last").attr('id').match(/[0-9]/)) | |
var tr = $('#birthday-setting\\['+num+'\\]') | |
num++ | |
tr.clone(true) | |
.insertAfter(tr) |
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
<table id="birthday-table"> | |
<thead> | |
<tr> | |
<th>誕生月</th> | |
<th>誕生日</th> | |
<th>削除</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr id="birthday-setting[0]" > |
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
Future.traverse(list) { listId => | |
caRepository.findById(listId) filter { | |
case Some(c) => c.status match { | |
case Stopped => false | |
case _ => true | |
} | |
} map { cs => | |
cs.get.id.get | |
} | |
} |