Skip to content

Instantly share code, notes, and snippets.

View stuartelimu's full-sized avatar
🎯
Focusing

Stuart Elimu stuartelimu

🎯
Focusing
View GitHub Profile
@stuartelimu
stuartelimu / .htaccess
Created July 6, 2019 11:28
Laravel setup file for infinityfree.net
##################################################
#
# Replace the fields with your app and domain name
#
##################################################
DirectoryIndex <app name>/public/index.php index.html index.htm index2.html
RewriteEngine on
const FORM = document.querySelector('form');
const submit = (e) => {
// prevent default action ie page refresh
e.preventDefault();
// submit form
FORM.submit();
@stuartelimu
stuartelimu / README.md
Last active August 1, 2021 00:34
Hello, world

I am tryin to piece things together.

@stuartelimu
stuartelimu / README.md
Created August 1, 2021 00:23
Hello, world!

i am tryin to piece things together

license: gpl-3.0
height: 500
scrolling: no
border: yes
@stuartelimu
stuartelimu / ausers-urls.py
Last active February 22, 2021 18:28
Article
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('accounts.urls')),
]
@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.

@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.