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
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
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
{ | |
"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
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
import pandas as pd | |
df=pd.DataFrame([[1,2,3], | |
[10,20,30], | |
[100,200,300], | |
[1000,2000,3000], | |
[1000,2000,3001], | |
[1000,2000,3002], | |
[1000,2000,3003]], | |
columns=['A','B','C']) |
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 test_mail(user) | |
email = mail(to: "[email protected]", subject: "ようこそ") | |
email.mailgun_options = {tag: "test_mail_tag"} | |
end |
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
from selenium import webdriver | |
from getpass import getpass | |
def login_twitter(username, password): | |
driver = webdriver.Firefox() | |
driver.get("https://twitter.com/login") | |
username_field = driver.find_element_by_class_name("js-username-field") | |
password_field = driver.find_element_by_class_name("js-password-field") |
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
from mixpanel import Mixpanel | |
PROJECT_TOKEN = '******' | |
user_id = '1' | |
mp = Mixpanel(PROJECT_TOKEN) | |
mp.track(user_id, 'Push Test', {'property_test' : '吉祥寺井の頭公園三鷹台久我山富士見ヶ丘高井戸浜田山西永福永福町明大前東松原新代田下北沢池の上駒場東大前新泉渋谷abcdef新宿代々木原宿渋谷恵比寿目黒五反田大崎品川田町浜松町新橋有楽町東京神田秋葉原御徒町上野'}) | |
# return '255' |
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
/* | |
### 前提 | |
- slack webhookはstore parameterに保管している | |
- アラートの重要度ごとにhookを作る | |
- SEVERITYとCOLORをlambdaの環境変数に設定する | |
*/ | |
const url = require('url'); | |
const https = require('https'); | |
const AWS = require('aws-sdk'); |