Skip to content

Instantly share code, notes, and snippets.

@LD8
LD8 / ssh_key_set_up.md
Last active December 25, 2019 04:23
How to set up SSH Key for GitHub

This is my first time to push a repo without using an http link so I need to generate a new SSH key. Followed the instruction on github:

Step 1 create a new ssh key, using the provided email as a label

$ ssh-keygen -t rsa -b 4096 -C "[email protected]"

# Press Enter when:
> Enter a file in which to save the key (/Users/you/.ssh/id_rsa):
# which accepts the default file location which is ~/.ssh/ folder
@LD8
LD8 / local_to_github.md
Last active December 25, 2019 05:07
Easiest Way to connect a local folder to a repo

New to GitHub, still trying to figure out the mechanism and here're some notes re how to connect local folder with a repo and vice versa:

1. Create a repository

It is recommended to create a repository directly from GitHub.com by using the beautiful and minimal UI provided. So do that before anything else.

2. Open local terminal

Now, there are two ways to connect a local folder to a repo on the site:

  • clone --> copy & paste locally --> add --> commit
  • 2.2 init --> add --> commit --> git remote origin --> pull --> push
@LD8
LD8 / django_setup.md
Created December 25, 2019 08:32
Django setup command
$ python3 -m venv venv

$ source venv/bin/activate

(venv)$ pip install django
# OR for some Chinese users to install faster $ pip install django -i https://pypi.douban.com/simple

(venv)$ django-admin startproject <project_name> .
# DO NOT forget to type the dot at the end!!!
@LD8
LD8 / gist_markdown_examples.md
Created December 25, 2019 08:52 — forked from ww9/gist_markdown_examples.md
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@LD8
LD8 / gist_blog.md
Created December 25, 2019 08:53 — forked from ww9/gist_blog.md
Using Gist as a blog #blog

Blogging with Gist

Gist simplicity can turn blogging into a liberating experience.

Pros Cons
✅ Free, simple, fast, hassle-free ❌ Image upload in comments only
✅ Tagging ❌ No post pinning
✅ Search ❌ Doesn't look like a blog
✅ Revisions ❌ Unfriendly URLs
@LD8
LD8 / gist:1436f060fc7dfcdfdf3e29126c00ddfc
Created December 25, 2019 08:53
HTML Escape / Unescape
Escapes or unescapes an HTML file removing traces of offending characters that could be wrongfully interpreted as markup.
The following characters are reserved in HTML and must be replaced with their corresponding HTML entities:
```
" is replaced with &quot;
& is replaced with &amp;
< is replaced with &lt;
> is replaced with &gt;
```
@LD8
LD8 / Django3+Python3_in_AWS_Lightsail.md
Last active May 1, 2020 09:31
Commands to install python3, postgres, django3, gunicorn, nginx, cerbotSSL in AWS Lightsail VPS Ubuntu 18.04

sudo apt-get update && sudo apt-get upgrade

sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl

sudo -H pip3 install --upgrade pip sudo -H pip3 install virtualenv

sudo -u postgres psql

CREATE DATABASE myproject;