Skip to content

Instantly share code, notes, and snippets.

目的

md2reviewでRe:VIEWに変換したときに表示が崩れないこと

タイミング

マークダウン原稿(.mdファイル)を受け渡すときにチェックしてください

内容

@yuzutas0
yuzutas0 / postgre2gcs.rb
Created January 16, 2019 06:52
Cloud SQL (PostgreSQL) の Dumpファイル からテーブル一覧を抽出するRubyスクリプト。DB接続なし・GCSアクセスだけで動かしたいときに使う(かも)。
# arg0: dump file
dump = []
f = open(ARGV[0])
while line = f.gets
dump.push(line)
end
f.close
create_table = []
@yuzutas0
yuzutas0 / pg2bq.rb
Last active January 24, 2019 07:45
PostgreSQLのDumpファイルからBigQueryのスキーマ情報を生成するためのRubyスクリプト
# arg0: dump file
require 'json'
dump = []
f = open(ARGV[0])
while line = f.gets
dump.push(line)
end
f.close
@yuzutas0
yuzutas0 / bq_memo.md
Created April 17, 2019 10:10
BQとかのメモ

FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE, INTERVAL 0 DAY))

@yuzutas0
yuzutas0 / google_form_to_slack_by_gas.md
Created April 29, 2019 10:49
GoogleFrom to Slack by GAS

1. set incoming-webhook at slack

  • click channel name
  • Add an app
  • incomming-webhook
  • add configration
  • set target channel and bot name
  • get url

2. add gas

@yuzutas0
yuzutas0 / slideshare.sh
Last active April 29, 2019 15:47
SlideShareで日本語スライドを表示する
$ cp {pdf_file} {pdf_file_copied}
$ LANG=C LC_ALL=C sed -i '' s'|/Registry (Adobe) /Ordering (Japan1) /Supplement [0-9]|/Registry(Adobe) /Ordering(Identity) /Supplement 0|g' {pdf_file}
@yuzutas0
yuzutas0 / big_csv_print_debug.rb
Last active May 28, 2019 07:49
BQへのデータロードが失敗したからCSVファイルの該当レコードを読もうとするが、ファイルが巨大すぎてiTermが落ちたときに私は思ったんだ。該当レコードとその前後だけを抽出するスクリプトがあると便利じゃないか? ーー そう、それがすべての始まり。だからこそ、今ここにいる。僕の言葉ではない、これは僕達の言葉。 ーー 完。
# ruby big_csv_print_debug.rb input_file=test.csv output_file=result.csv line_number=10
arg = {}
ARGV.each do |s|
k, v = s.split('=')
arg[k] = v
end
p arg
target_lines = []
@yuzutas0
yuzutas0 / cloud-composer-broken-dag-error-log.sh
Created June 11, 2019 08:43
Cloud Composer: Broken DAG のエラーログを見るコマンド
$ gcloud composer environments run ${instance_name} --location="${location}" list_dags
@yuzutas0
yuzutas0 / mysql_dump_tsv_to_bigquery_by_dataflow.py
Created June 22, 2019 05:19
ETL Logic: MySQL TSV Dump -> BigQuery by Python3.5 Dataflow
import re
magic_word = '{{{{{converted_by_yuzutas0_dataflow}}}}}'
text = text.replace('\\\"', '\"\"').replace('\\\\', magic_word) \
.replace('\\\"', '\\').replace(magic_word, '\\\\')
text = re.sub(r'\\$', '', text, flags=re.MULTILINE)
if text.startswith('""') and not text.startswith('"""'):
text = text[1:]
@yuzutas0
yuzutas0 / 2020-03-05-requirement.md
Last active March 5, 2020 05:24
[2020-03-05] 【募集】新規事業のプロトタイプ画面実装

フロントエンドの副業案件です! 土日でガーッと作って15万円を稼ごう!

目的

  • 新規事業のユーザーインタビュー用のプロトタイプを作る
    • 画面上で検索や絞り込みを行いたいので、デザインツールではなくフロント実装を依頼したい

案件概要