Skip to content

Instantly share code, notes, and snippets.

View spidezad's full-sized avatar

Tan Kok Hua spidezad

  • Seagate Technology
View GitHub Profile
spidezad / Sublime text for python IDE
Last active February 19, 2020 06:42
Sublime text Configure for python IDE
# youtube ref
# terminal in sublime text
# Configure terminus --key binding only work in windows
# command palatte --> install packages --> terminus
spidezad / BasicDjangoSimpleProject
Last active January 16, 2020 15:19
## From Django Tutorial
# Create Project
django-admin startproject mysite
# Create Apps
python startapp polls
# Add app to
spidezad / django_static_files
Last active January 15, 2020 13:53
Django static files Notes
# update for new app
# create in app
# create in app
# update 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' %}">
spidezad / psql commands
Created December 15, 2019 14:55
PSQL Commands
# Start PostgreSQL server
pg_ctl -D /usr/local/var/postgres start
# list all database
# help on all commands
# connect to database
spidezad / gist:99e889feea264144ccf3317c27c33a6d
Created December 9, 2019 14:25
Mac OS virtualenv Python issue
#pip suddenly not working (SSL related)
brew reinstall python3
# if python2 on os
curl | sudo python2
# git clone and pip install requirements
git clone
pip install -r requirements.txt
spidezad / gist:0b94db32fbb40f98b5160dd2e4abd602
Created December 3, 2019 14:53
Installing Postgres on Mac
# 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
spidezad / gist:7bf2a7e6af3392b1e6ee5ea6591b35ce
Last active November 27, 2019 15:04
VirtualEnvWrapper Notes
pip install virtualenvwrapper
mkvirtualenv env1
lssitepackages #see new packages
workon env1
# make virtualenv with python3
mkvirtualenv env1 --python=python3
sns.heatmap(df.isnull(), yticklabels=False, cbar = False, cmap = 'viridis')
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)