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 airflow import DAG | |
from airflow.operators.bash_operator import BashOperator | |
from airflow.operators.python_operator import PythonOperator | |
import os | |
import datetime | |
import slackweb | |
WEBHOOK_URL = os.environ["WEBHOOK_URL"] | |
AIRFLOW_URL = os.environ["AIRFLOW_URL"] |
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 os | |
import datetime | |
from airflow import DAG | |
from airflow.contrib.operators.gcs_to_bq import GoogleCloudStorageToBigQueryOperator | |
default_args = { | |
"start_date": datetime.datetime(2018, 1, 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
def convert_pref(pref): | |
if pref=='茨城': | |
return 'ibaraki' | |
elif pref=='岐阜': | |
return 'gifu' | |
elif pref=='静岡': | |
return 'shizuoka' | |
elif pref=='千葉': | |
return 'chiba' | |
elif pref=='大阪': |
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 airflow import DAG | |
from airflow.operators.python import PythonOperator | |
from airflow.operators.bash import BashOperator | |
from datetime import datetime | |
def test_func(): | |
print('Hello from test_func') | |
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 json | |
from time import sleep | |
from requests_oauthlib import OAuth1Session | |
CK = "" | |
CS = "" | |
AT = "" | |
ATS = "" |
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'); |
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
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
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
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']) |