Skip to content

Instantly share code, notes, and snippets.

View macoril's full-sized avatar
🐴
🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴

macoril

🐴
🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴 🏇 🐴
View GitHub Profile
@macoril
macoril / long_time_no_touch_customer_list_notification_zap.py
Last active July 2, 2022 10:45
This code is to retrieve records from a Notion table filtering by the value of a date property and notify on a Slack channel via Zapier.
"""
# This code works on a Zapier Action of "Code by Zapier" choosed its "Action Event" as "Run Python".
# Please set some values as "Input Data"
# - NOTION_BEARER_TOKEN : e.g. Bearer secret_aBcDefg...
# - NOTION_VERSION : e.g. 2022-02-22
# - DATABASE_ID : e.g. 12ab3c...
# - PROPERTY_NAME_OF_LAST_CONTACT_DATE : e.g. last contacted at
# - PROPERTY_NAME_OF_CHURN_DATE : e.g. churned at
"""
@macoril
macoril / race_entry.py
Last active January 30, 2021 13:44
JBISからグラスワンダー系の出走予定を取得して出力(ターミナル上&csv)
import csv
import requests
from bs4 import BeautifulSoup
def main():
stallions = [
{'name' : 'グラスワンダー', 'id' : '0000299089'}
,{'name' : 'スクリーンヒーロー', 'id' : '0000801447'}
,{'name' : 'アーネストリー', 'id' : '0000885246'}
,{'name' : 'モーリス', 'id' : '0001138240'}
@macoril
macoril / metabase_api_exe.sh
Created July 27, 2020 22:33
metabaseのAPIを実行するシェルスクリプト。セッションが死んでたら取得し直す。
#!/bin/bash
# usage:
# . ./metabase_api_exe.sh [HTTP method] [path]
# sample:
# . ./metabase_api_exe.sh GET /api/pulse
urlbase='http://path.to.your.metabase'
username='your_account@example.com'
password='your_password'
@macoril
macoril / baseconverter_for_alias
Last active March 19, 2019 11:52
a shell command alias to convert a number to different base easily
# copy to your bash_profile or somewhere you write aliases,
# then you can convert a number to different base by cbase
# エイリアスを設定しているあたりにでも以下のコードをコピペすると基数変換がcbaseコマンドで簡単できるようになります
function cbase() {
function echo_usage() {
cat << USAGE
usage: cbase [-i num] [-o num] num
-i num
Set a number of base you want to convert FROM.
Default is 10.