memo
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
nohup sh ./train.sh > out.log & | |
tail -f ./out.log | |
ps aux | grep sh |
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 psutil | |
import humanize | |
import os | |
import GPUtil as GPU | |
GPUs = GPU.getGPUs() | |
# XXX: only one GPU on Colab and isn’t guaranteed | |
gpu = GPUs[0] | |
def printm(): | |
process = psutil.Process(os.getpid()) | |
print("Gen RAM Free: " + humanize.naturalsize( psutil.virtual_memory().available ), " | Proc size: " + humanize.naturalsize( process.memory_info().rss)) |
$ rails g model Article name:string
$ rails g migration AddColumnTitles # Alter, Drop, Create, Change
$ rails db:rollback
remove_index :items, [:shop_id, :item_id]
add_index :items, :item_id
vertical-align middle line-height
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
async function sleep() { | |
console.log("good night") | |
await new Promise(r => setTimeout(r, 2000)) | |
console.log("zzzz") | |
} |
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 print = () => { | |
console.log('This is first') | |
} | |
const sleep = (waitSeconds, someFunction) => { | |
return new Promise(resolve => { | |
setTimeout(() => { | |
resolve(someFunction()) | |
}, waitSeconds * 1000) | |
}) |