Skip to content

Instantly share code, notes, and snippets.

View stuartelimu's full-sized avatar
🎯
Focusing

Stuart Elimu stuartelimu

🎯
Focusing
View GitHub Profile
const FORM = document.querySelector('form');
const submit = (e) => {
// prevent default action ie page refresh
e.preventDefault();
// submit form
FORM.submit();
@stuartelimu
stuartelimu / README.md
Created August 1, 2021 00:23
Hello, world!

i am tryin to piece things together

@stuartelimu
stuartelimu / README.md
Last active August 1, 2021 00:34
Hello, world

I am tryin to piece things together.

license: gpl-3.0
height: 500
scrolling: no
border: yes
@stuartelimu
stuartelimu / Change article Django site admin.png
Last active July 5, 2020 20:54
Using get_absolute_url() model instance method in Django
Change article Django site admin.png

Hello, world! carbon

@stuartelimu
stuartelimu / createsuperuser.md
Last active July 5, 2020 06:09
Easily create a superuser for your django project

Easily create a superuser for your django project using this simple line.

I found this trick on the Quickstart guide from the django-rest-framework docs

$ python manage.py createsuperuser --username admin --email admin@example.com
Password: **********
Password (again): **********
Superuser created successfully.

Hello, world!

ab
@stuartelimu
stuartelimu / git-cheatsheet.md
Last active February 11, 2021 05:17
Git Cheatsheet

Undo git add

You can undo git add before commit with

git reset <file>

You can use

git reset

without any file name to unstage all due changes. This can come in handy when there are too many files to be listed one by one in a reasonable amount of time.