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
# youtube ref | |
https://www.youtube.com/watch?v=t2A_4gWzg8c | |
# terminal in sublime text | |
https://www.youtube.com/watch?v=sRxpxFDGLXI | |
# Configure terminus --key binding only work in windows | |
https://github.com/James231/Terminals-In-Sublime-Text | |
# command palatte --> install packages --> terminus |
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
## From Django Tutorial | |
# Create Project | |
django-admin startproject mysite | |
# Create Apps | |
python manage.py startapp polls | |
# Add app to settings.py |
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
# update settings.py for new app | |
# create views.py in app | |
# create urls.py in app | |
# update urls.py in main | |
# add in various html template in app_name/templates | |
# for the html template | |
{% load static %} | |
# specifying a static file | |
<link rel="stylesheet" type="text/css" href="{% static 'appsname/style.css' %}"> |
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
# Start PostgreSQL server | |
pg_ctl -D /usr/local/var/postgres start | |
# list all database | |
\l | |
# help on all commands | |
\? | |
# connect to database |
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
#pip suddenly not working (SSL related) | |
brew reinstall python3 | |
link: https://stackoverflow.com/questions/58280484/ssl-module-in-python-is-not-available-on-osx | |
# if python2 on os | |
curl https://bootstrap.pypa.io/get-pip.py | sudo python2 |
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
# git clone and pip install requirements | |
git clone https://github.com/eleanorstrib/deploying-django.git | |
pip install -r requirements.txt | |
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
Ref: https://medium.com/@Umesh_Kafle/postgresql-and-postgis-installation-in-mac-os-87fa98a6814d | |
# Remove previous versions of PostgreSQL | |
brew uninstall --force postgresql | |
# Delete all Files of Postgres | |
rm -rf /usr/local/var/postgres | |
# Install Postgres with Homebrew | |
brew install postgres |
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
https://virtualenvwrapper.readthedocs.io/en/latest/ | |
pip install virtualenvwrapper | |
mkvirtualenv env1 | |
lssitepackages #see new packages | |
workon env1 | |
echo $VIRTUAL_ENV | |
# make virtualenv with python3 | |
mkvirtualenv env1 --python=python3 |
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
sns.heatmap(df.isnull(), yticklabels=False, cbar = False, cmap = 'viridis') |
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
from keras.utils import np_utils | |
from sklearn.preprocessing import LabelEncoder | |
labelenc = LabelEncoder() | |
y_enc = labelenc.fit_transform(y) | |
y_onehot = np_utils.to_categorical(y_enc) | |
y_onehot |
NewerOlder