🌟 Nice to meet you here! I: 🌟 Started learning programming since primary school 🌟 Love working on projects with social impact 🌟 Interested in Deep Learning and Full Stack development 🌟 Also interested in Cognitive Science and Data Science
This file contains 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
def seed_everything(seed: int): | |
import random, os | |
import numpy as np | |
import torch | |
random.seed(seed) | |
os.environ['PYTHONHASHSEED'] = str(seed) | |
np.random.seed(seed) | |
torch.manual_seed(seed) | |
torch.cuda.manual_seed(seed) |
This file contains 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 torch | |
import sys | |
assert len(sys.argv) == 3, "Arguments: source_pth dest_pth" | |
loaded_pth = torch.load(sys.argv[1], map_location="cpu") | |
torch.save(loaded_pth, sys.argv[2], _use_new_zipfile_serialization=False) |
This file contains 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
convert -density 300 input_pdf.pdf a.png; convert a*.png a.pdf |
- nginx 返回Cache时间 Expires 客户端Cache 配合 https://github.com/JeffreyWay/laravel-mix/blob/master/docs/versioning.md
- nginx gzip
This file contains 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
a2enmod headers | |
a2enmod rewrite | |
a2enmod proxy_http | |
service apache2 restart | |
This file contains 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
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php | |
apt-get update | |
apt-get remove php7.0 -y | |
apt-get install php7.2 php7.2-mbstring php7.2-dom php7.2-mysql php7.2-curl -y | |
a2dismod php7.0 | |
a2enmod php7.2 | |
service apache2 restart |
This file contains 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
<?php | |
$connectstr_dbhost = ''; | |
$connectstr_dbport = ''; | |
$connectstr_dbname = ''; | |
$connectstr_dbusername = ''; | |
$connectstr_dbpassword = ''; | |
foreach ($_SERVER as $key => $value) { | |
if (strpos($key, "MYSQLCONNSTR_localdb") !== 0) { |