$ npm list mdast-util-find-and-replace
my-app@0.1.0 /home/rkaneko/workspace/axelglobe/docs.axelglobe.com
└─┬ remark-gfm@3.0.1
└─┬ mdast-util-gfm@2.0.1
└─┬ mdast-util-gfm-autolink-literal@1.0.3
└── mdast-util-find-and-replace@2.2.2
$ npm list mdast-util-find-and-replace
my-app@0.1.0 /home/rkaneko/workspace/axelglobe/docs.axelglobe.com
└─┬ remark-gfm@3.0.1
└─┬ mdast-util-gfm@2.0.1
└─┬ mdast-util-gfm-autolink-literal@1.0.3
└── mdast-util-find-and-replace@2.2.2
WITH original AS ( | |
SELECT | |
ST_Collect(ST_ShiftLongitude(ST_GeomFromGeoJSON(feat->>'geometry'))) geom | |
FROM (SELECT json_array_elements('HERE_IS_FEATURE_COLLECTION_GEOJSON'::json->'features') AS feat) AS f | |
) | |
SELECT ST_AsGeoJSON(o.geom) FROM original o LIMIT 1; |
import time | |
import multiprocessing as mp | |
import psutil | |
from typing import Any, Callable, List, Tuple | |
def monitor(target: Callable[..., Any], args: Tuple[Any, ...]) -> List[float]: | |
worker_process = mp.Process(target=target, args=args) | |
worker_process.start() | |
p = psutil.Process(worker_process.pid) |
from typing import Any, Dict, List | |
import s3fs | |
from pyarrow import Table, parquet as pq | |
from pandas import DataFrame, Series | |
def to_df(data: List[Dict[str, Any]]) -> DataFrame: | |
df = DataFrame() | |
for item in data: | |
indexes = [] | |
values = [] |
# display privileges
SELECT grantee, privilege_type FROM information_schema.role_table_grants WHERE table_name='some_table_name';
grantee | privilege_type
-----------+----------------
root | INSERT
root | SELECT
root | UPDATE
root | DELETE
$ cat origin.csv
id,created,notes
1,1518393600000,blahblah
2,1518393600000,foobar
# Case1: We want to all column2 values (e.g. unix timestamp-ish value) to formatted datetime
$ head -1 origin.csv > /dev/stdout && tail origin.csv -n+2 | awk -F "," '{gsub($2, strftime("%Y-%m-%d %H:%M:%S", substr($2, 0, 10))); print}' >> /dev/stdout
import logging | |
import psycopg2 | |
import sys | |
import traceback | |
logging.basicConfig(level=logging.INFO) | |
log = logging.getLogger(__file__) | |
log.setLevel(logging.INFO) | |