Skip to content

Instantly share code, notes, and snippets.

View t-kurimura's full-sized avatar
🛴

TakahisaKurimura t-kurimura

🛴
View GitHub Profile
@t-kurimura
t-kurimura / footsal_tourment_list.py
Last active March 14, 2020 16:08
フットサルの大会見つけるやつ
import re
import datetime
import locale
import urllib3
import urllib.parse
from bs4 import BeautifulSoup
def safe_cast(val, to_type, default=None):
try:
def create_series_dag(parent_dag_name, table_name):
subdag = DAG(
dag_id="%s.%s" % (parent_dag_name, "child_task"),
default_args=dag_args,
)
delete = BigQueryTableDeleteOperator(
task_id="delete_summary_table",
deletion_dataset_table="{}.{}.{}".format(PROJECT_ID, DATASET_ID, table_name),
bq --format=prettyjson show dataset_id.table_name | jq .schema > schema_def.json
@t-kurimura
t-kurimura / udf.sql
Last active December 12, 2019 07:44
Persistent UDF(Beta)
# deleted
Bundle().apply {
putString(FirebaseAnalytics.Param.ITEM_ID, id)
putString(FirebaseAnalytics.Param.ITEM_NAME, name)
putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image")
}.let { bundle ->
FirebaseAnalytics.getInstance(this)
.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle)
}
SELECT
user_pseudo_id,
platform,
FORMAT_TIMESTAMP("%c", TIMESTAMP_MICROS(event_timestamp)) as time,
MAX(case when eventParams.key = "firebase_screen_class" then eventParams.value.string_value else null end) as transit_to,
MAX(case when eventParams.key = "firebase_previous_class" then eventParams.value.string_value else null end) as transit_from
FROM
`{your_project}.analytics_{your_id}.events_20*`,
UNNEST(event_params) as eventParams
WHERE
binding.rootMotionLayout.setTransitionListener(object: MotionLayout.TransitionListener {
override fun onTransitionChange(view: MotionLayout?, fromSceneId: Int, toSceneId: Int, progress: Float) 
// 進行状況を検知 
}
override fun onTransitionCompleted(view: MotionLayout?, completedState: Int) {
// 終了を検知
}
})
// end_1の状態にアニメーションなしで遷移したいとき
binding.motionLayout.transitionToState(R.id.end_1)
// start_1の状態にアニメーションして遷移したいとき
binding.motionLayout.transitionToStart()
// end_1の状態にアニメーションして遷移したいとき
binding.motionLayout.transitionToEnd()
<Transition
motion:constraintSetEnd="@id/end_1"
motion:constraintSetStart="@id/start_1"
motion:duration="200">
<OnSwipe
… />
</Transition>