View Sublime text for python IDE
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 |
View BasicDjangoSimpleProject
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 |
View django_static_files
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' %}"> |
View psql commands
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 |
View gist:99e889feea264144ccf3317c27c33a6d
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 |
View Git Commands
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 | |
View gist:0b94db32fbb40f98b5160dd2e4abd602
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 |
View gist:7bf2a7e6af3392b1e6ee5ea6591b35ce
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 |
View gist:234ee266abcd1b54ea3d379abbe94c97
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') |
View gist:29ab9555db9238253cc720f33435d94c
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