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
#!/bin/bash | |
# Tested Environments : Centos6 | |
start_script_on_background() { | |
echo "nohup ${1} > ${2} &" | |
nohup ${1} > ${2} & | |
} | |
get_script_path() { | |
SCRIPT=`readlink -e $0` |
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
# Does Python have a string 'contains' substring method? | |
# https://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method | |
if "blah" not in somestring: | |
continue |
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
## Install chrome driver | |
# https://chromedriver.storage.googleapis.com/index.html?path=2.43/ | |
def execute_with_message(statement): | |
print("Execute... {}".format(statement)) | |
result = get_result_from_subprocess(statement) | |
print("Done message=[{}]".format(result)) | |
def get_result_from_subprocess(cmd): | |
return (subprocess.check_output(cmd, shell=True)).decode("utf-8") |
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
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) | |
#define LOG_WARN_JYP(str) \ | |
if (WARN <= g_logLevel) { \ | |
LOG_JYP(str) \ | |
}; | |
#define LOG_DEBUG_JYP(str) \ | |
if (DEBUG <= g_logLevel) { \ | |
LOG_JYP(str) \ |
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
#### Docker | |
docker build -t tfn2mt_base -f tfn2mt/Dockerfile.cpu . && docker run --runtime=nvidia -it --rm tfn2mt_base |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<section id="data"></section> | |
</body> | |
<script> |
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
#!/usr/bin/python | |
import sys | |
print("sys.version==[{}]".format(sys.version)) |
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
const Github = class { | |
constructor(id, repo) { | |
this._base = `https://api.github.com/repos/${id}/${repo}/contents/`; | |
} | |
load(path) { | |
return new Promise((res, rej) => { | |
const id = 'callback' + Github._id++; | |
const f = Github[id] = ({data: { content }}) => { | |
delete Github[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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<img id="a"> | |
<section id="b"></section> | |
<br/> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<img id="a"> | |
<section id="b"></section> | |
<br/> |
OlderNewer