Skip to content

Instantly share code, notes, and snippets.

View sadan's full-sized avatar
🎯
Focusing

Sadan A. sadan

🎯
Focusing
View GitHub Profile
@101t
101t / python-cheatsheet.md
Last active March 30, 2024 06:57
Python Cheatsheet
@wsvincent
wsvincent / admin.py
Created November 2, 2018 19:23
Django Custom User Model for any new project
# users/admin.py
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserCreationForm, CustomUserChangeForm
from .models import CustomUser
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
@knowsuchagency
knowsuchagency / Dockerfile
Created July 16, 2018 05:08
Makefile Docker Git GitHub multi-stage build ssh private key recipe
FROM python:3 as build-system
RUN pip install -U pip
COPY requirements.txt requirements.txt
### create temporary image used to download and vendor packages using private key ###
FROM build-system as intermediate
# add credentials on build
@datchley
datchley / react-redux-style-guide.md
Last active February 13, 2024 14:30
React + Redux Style Guide
@nitinbhojwani
nitinbhojwani / django_send_mail
Created May 4, 2016 18:33
Django - Send a Mail with Attachment File like CSV
# Import EmailMessage class - https://docs.djangoproject.com/en/1.9/topics/email/#django.core.mail.EmailMessage
from django.core.mail import EmailMessage
email = EmailMessage('... Subject ...', '... Body ...', 'from-email',
['to-email-1', 'to-email-2'], ['bcc-email-1', 'bcc-email-2'])
# now let's create a csv file dynamically
import csv, StringIO
attachment_csv_file = StringIO.StringIO()
writer = csv.writer(attachment_csv_file)
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 6, 2024 07:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites