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 / gist:f3e6d2be1def6b1c09564bd08989a141
Created November 17, 2017 01:10
mail server (autoload postfix)
sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.postfix.master.plist
@Tdual
Tdual / gist:fe74fdac95815a61699334368fb3430f
Created November 20, 2017 07:52
install conda kernel to jupyter
python -m ipykernel install --name <conda kernel name>
@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)
@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)
defaults write com.apple.finder AppleShowAllFiles TRUE
killAll Finder
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.
@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":