Skip to content

Instantly share code, notes, and snippets.

Working from home


Working from home
View GitHub Profile
agusmakmun /
Created December 22, 2022 14:36 — forked from dmmeteo/
SOLID Principles explained in Python with examples.
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
class Animal:
def __init__(self, name: str):
import operator
from collections import OrderedDict
from django.utils.translation import gettext_lazy as _
class EnumMetaClass(type):
def __init__(cls, name, bases, classdict):
def _human_enum_values(enum):
return cls.__choices__[enum]
agusmakmun /
Last active October 21, 2021 04:14
Mac Cheat Sheet
  1. Minimize app in dock: Opt + Click the icon app (
  2. Screenshot: ⌘ cmd + Shift + 3/4
  3. Record Screen: ⌘ cmd + Shift + 5 -
  4. Set primary display:
  5. GIF Screen Recorder: ???
  6. Set default editor to nano:
  7. Resize window:
  8. See all opened windows: System Preferences > Mission Control > Keyboard & Mouse Shortcuts => Mission Control : Left Option -
  9. make auto-hide/show for the dock faster - defaults write autohide-time-modifier -float 0.5;killall Dock
agusmakmun /
Last active September 29, 2021 08:37
Modify the default Django admin login form without modifying the entire models to new AdminSite

For example we want to modify the default login form with only add new reCAPTCHA feature. Ya, because previously I have an issue about brute forcing password to this page. So, we should add it reCAPTCHA to fix the fuln issue.

Option 1

We can just overwrite the default admin site from django.

  1. myapp/
agusmakmun / 1.permissions-haulier.json
Last active November 5, 2020 07:57
can be partial & FE doesn't need to send the "description" field because it read-only fields. Note: this valid format focused on "generalPermissions".
View 1.permissions-haulier.json
"dashboard": {
"generalPermissions": []
"scheduler": {
"generalPermissions": [
"code": "scheduler.add_plantrip",
"description": "Can add plan trip"
agusmakmun /
Last active November 1, 2020 23:32
  1. Introduction about yourself.

Let me introduce my self, My name is Agus Makmun, and I was 26 years old. I come from South Sumatera, indonesia. And I was bachelor's degree in computer science at university muhammadiyah of surakarta.

I have exposure working every aspect of the software development with Python, Django, Rest API, Web Development, AWS (Lightsail, S3, EC2, RDS), Digital Ocean, Python Anywhere, other VPS Deployment, Microservices & Legal Scraping.

agusmakmun /
Created May 8, 2020 06:57 — forked from dnmellen/
How to create a unittest for a "View" Mixin (Django Testing)
from django.test import TestCase, RequestFactory
from django.views.generic import TemplateView
from ..lib.views import YourMixin
class YourMixinTest(TestCase):
Tests context-data in a Django Mixin like a boss
agusmakmun /
Created March 12, 2020 04:52
How to make a notification when terminal process is complete

I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be notified through a sound or another notification.

You can use this some alternatives;

$ your-bash-command && aplay /path/to/sound.wav  # can also with *.ogg file.
View Lamidi

Toko Sembako LAMIDI, menyediakan:


Kebutuhan Pokok Herbal Lainnya
Beras Air Zam-zam Aneka Sabun & Samphoo
Gas LPG Kopi Radix Aneka Jajan
Bensin/Pertalite Odol Radix Aneka Minuman
Dedak Minyak Zaitun Aneka Bumbu dapur
agusmakmun / gist:6bef2e4b4d86141b7bb248c01fa94604
Created July 24, 2019 13:58 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
View gist:6bef2e4b4d86141b7bb248c01fa94604
<!doctype html>
<title>Site Maintenance</title>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }