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
| { | |
| 'task': 'preview', | |
| 'data': { | |
| "article_html": "<!DOCTYPE html>\r\n<html class=\"sapphire drawer--layout viewport--xs viewport--xs-only is-logged-out no-js\">\r\n<head>\r\n <base href=\"http://www.bizjournals.com/baltimore/news/2016/11/02/\">\r\n <script type='text/javascript'>var _sf_startpt = (new Date()).getTime()</script>\r\n <script src=\"//assets.adobedtm.com/4ea7bf50a24b9cc15d03d9f7a75a849dfbcc6242/satelliteLib-d49ec218aa23da4a5a424ec20dacb8e9e5098f27.js\"></script>\r\n <script type=\"text/javascript\" src=\"//s.ntv.io/serve/load.js\" async></script>\r\n <title>T. Rowe Price, Sterling Partners funds lose millions as Texas company's stock plunges - Baltimore Business Journal</title>\r\n <base href=\"http://www.bizjournals.com/\">\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n<!--Built Head Meta-->\r\n <meta name=\"metered_paywall:json\" content=\"{"interval |
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
| '{"task": "preview", "data": {"article_html": "<!DOCTYPE html>\\r\\n<html class=\\"sapphire drawer--layout viewport--xs viewport--xs-only is-logged-out no-js\\">\\r\\n<head>\\r\\n <base href=\\"http://www.bizjournals.com/baltimore/news/2016/11/02/\\">\\r\\n <script type=\'text/javascript\'>var _sf_startpt = (new Date()).getTime()</script>\\r\\n <script src=\\"//assets.adobedtm.com/4ea7bf50a24b9cc15d03d9f7a75a849dfbcc6242/satelliteLib-d49ec218aa23da4a5a424ec20dacb8e9e5098f27.js\\"></script>\\r\\n <script type=\\"text/javascript\\" src=\\"//s.ntv.io/serve/load.js\\" async></script>\\r\\n <title>T. Rowe Price, Sterling Partners funds lose millions as Texas company\'s stock plunges - Baltimore Business Journal</title>\\r\\n <base href=\\"http://www.bizjournals.com/\\">\\r\\n <meta http-equiv=\\"X-UA-Compatible\\" content=\\"IE=edge\\">\\r\\n <meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1\\">\\r\\n<!--Built Head Meta-->\\r\\n <meta name=\\"metered_paywal |
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 asana | |
| asana_personal_token = "" # Personal Token | |
| project_id = 0 # Project id | |
| client = asana.Client.access_token(asana_personal_token) | |
| def cumpute_days(section): | |
| days = 0 | |
| for task in client.tasks.find_by_section(section): | |
| task_id = task['id'] |
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
| #coding: utf-8 | |
| import requests | |
| import pandas as pd | |
| import numpy as np | |
| from bs4 import BeautifulSoup as bs | |
| def financial_statement(year, season, type='綜合損益彙總表'): | |
| if year >= 1000: |
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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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 digit(num, position): | |
| return int(str(num)[position]) | |
| def is_of_digit(num, number): | |
| return len(str(num)) == number | |
| def up_to(num, to): | |
| return int(str(num)[:to+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
| # copied from https://github.com/apache/airflow/blob/main/airflow/models/dag.py | |
| from __future__ import annotations | |
| import logging | |
| import sys | |
| from datetime import datetime | |
| from typing import cast, Any, TYPE_CHECKING | |
| from airflow import DAG, settings | |
| from airflow.configuration import secrets_backend_list | |
| from airflow.exceptions import AirflowSkipException |
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
| version: '3.8' | |
| services: | |
| traefik: | |
| image: traefik:v2.10 | |
| command: | |
| - "--api.insecure=true" | |
| - "--providers.docker=true" | |
| - "--providers.docker.swarmMode=true" | |
| - "--providers.docker.exposedbydefault=false" |
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
| # 為 web01 (placeholder1) 設定標籤 | |
| docker node update --name web01 placeholder1 | |
| docker node update --label-add web=true --label-add cache=true --label-add grafana=true placeholder1 | |
| # 為 gateway01 (placeholder2) 設定標籤 | |
| docker node update --name gateway01 placeholder2 | |
| docker node update --label-add gateway=true --label-add logging_storage=true --label-add database=true placeholder2 |
OlderNewer