Skip to content

Instantly share code, notes, and snippets.

View Tdual's full-sized avatar
🏠
Working from home

tdual Tdual

🏠
Working from home
View GitHub Profile
@Tdual
Tdual / infer_freq
Created July 4, 2020 13:36
infer_freq
def infer_freq(self, pd_series):
d = {
"A": "year",
"M": "month",
"W": "week",
"D": "day",
"H": "hour",
"T": "min",
"S": "sec",
"L": "millisec",
{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "storage",
"host": {
"sourcePath": "/storage"
}
}
],
@Tdual
Tdual / gist:c4bdb0fbe9d9a48366319dddf45a24de
Created September 30, 2018 05:58
old api of matrixflow
@app.route('/upload', method="POST")
def upload_file():
files = request.files
res = fma.upload_file(files)
if res["status"] == "success":
name = res["detail"]["name"]
id = res["detail"]["id"]
save_path = fma.get_save_path(id)
cutout_res = cutout_face(save_path, name, save_path)
if cutout_res["status"] == "error":
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
defaults write com.apple.finder AppleShowAllFiles TRUE
killAll Finder
@Tdual
Tdual / gist:4d50382988a3661cc4bc311563b6fade
Created February 5, 2018 05:38
[psql] Updating nest jsonb.
select jsonb_set('{"a":{"b":"c"}}','{"a","b"}','"@@@"', false);
jsonb_set
---------------------
{"a": {"b": "@@@"}}
(1 row)
@Tdual
Tdual / gist:52ac6baeb42ffd8b912b1f920200dc05
Created December 12, 2017 03:01
remove all docker's images named none
docker rmi $(docker images -f "dangling=true" -q)