Skip to content

Instantly share code, notes, and snippets.

import feedparser
import openai
rss_url = "https://medium.com/feed/google-cloud"
def fetch():
# feedparserでRSSをパース
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -eu
EXIT_CODE=0
# `check $FILE_PATH $MESSAGE`: $FILE_PATH が存在してたら表示して EXIT_CODE を 1 に設定
function check () {
if [ -s $1 ]; then
echo $2
cat $1
EXIT_CODE=1
CREATE TEMPORARY FUNCTION
BEGIN_DATE() AS (TIMESTAMP("2021-06-17 00:00:00 Asia/Tokyo"));
CREATE TEMPORARY FUNCTION
END_DATE() AS (TIMESTAMP("2021-06-18 00:00:00 Asia/Tokyo"));
CREATE TEMP FUNCTION getAccessoryId(json_data STRING)
RETURNS ARRAY<INT64>
LANGUAGE js AS r"""
var values = [];
var row = JSON.parse(json_data);
for(var key in row){
CMDNAME=`basename $0`
if [ $# -ne 2 ]; then
echo "Usage: $CMDNAME account email" 1>&2
exit 1
fi
ACCOUNT=$1
EMAIL=$2
ZONE=us-west1-b
SERVICE_ACCOUNT=${ACCOUNT}[email protected]
#!/bin/bash
CMDNAME=`basename $0`
if [ $# -ne 1 ]; then
echo "Usage: $CMDNAME account" 1>&2
exit 1
fi
ACCOUNT=$1
ZONE=us-west1-b
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGpauHH26GxVXvjqColGcvlwMo4AnoxYqqeFDDx7+GW1ElY5BsBKHcqaJaJNgMMJjKHWJA/U5eHvTsMZzcD4l/RsSMZZWscZGncd7nP0u+3h6lYR24O+b3Nbmk2cNikUqgbbiQ8rsB/zJ0e4tSqYXllEdhIBqP5Mc1Q6YQvg9S//1f+coDffTq4YZIzGqljqqlfa14UwvP9l3p+W+yifjS5T24BIM7BIAhQuQiVD70S7TxYVXRtuFFSjKbSerDKjuppOTuqubBKyxAWoSpPaxV/kNfY4IVMygCDTj3FC5cffY+6Fv6K10zZU4UWVNQwZ5iBK4sO6Ka1D2/hfWr3gox4gF6ZL9RUc2NFVNCEg3nRHTmcqBmjTG+fOgFoTrwXNtW/lQSZ2ystluWlKx4Xcz9obO4Fl0SGn+zjd44dyizBKidyCCmPneV6YlWUlL9pu0F2btqDAHmsZ4cmqp6jHnizPEQKsNAbypjR0nuel/QdT0Y4wrqZeXVDOHVsw6gsXVf8cmDsFcvCXnmFkVgo0yiRV1DQHOKghBIxvAT5Y4DHgCgwH2ZQ8R+EIEOIb7EveVcgGsblVxWL7eacWtSALm+YTnKo3x9C9vLcAYRnhZqMUYFgFwh3FlATKdpu8aGs+jcK6mPTLJUFlXo6Oek9HXKezHQKdx4nNLgSNDmRbR6Tw== notes-generator
export IMAGE_URI=gcr.io/pj-kg-kpi/twitter_ai_platform
docker build -f Dockerfile -t $IMAGE_URI ./
docker push $IMAGE_URI
export MODEL_DIR=twitter_model_$(date +%Y%m%d_%H%M%S)
export REGION=us-central1
export JOB_NAME=twitter_search_training_$(date +%Y%m%d_%H%M%S)
gcloud ai-platform jobs submit training $JOB_NAME \
--region $REGION \
--master-image-uri $IMAGE_URI \
--scale-tier BASIC_GPU \
WITH pdata AS (
SELECT _PARTITIONDATE AS date, player_id, platform
FROM penguin_jp.person_data
WHERE
_PARTITIONDATE BETWEEN '2020-06-01' AND '2020-06-11'
)
SELECT _PARTITIONDATE AS date, pdata.platform, SUM(price)
FROM penguin_jp.virtual_coin AS v
JOIN pdata ON pdata.player_id=v.player_id AND pdata.date = v._PARTITIONDATE
WHERE
import os
import pwd
from subprocess import Popen
from optparse import OptionParser
myenv = """alias pythonexec='time ionice -n 7 -c 2 nice -n 19 {workdir}/bin/python'
alias rsyncd='rsync --daemon --verbose --port=11874 --config={home}/LOCAL/takada-at/rsync.conf --no-detach'
"""
screenrc = """escape ^T^T
defutf8 on