Skip to content

Instantly share code, notes, and snippets.

View shtalinberg's full-sized avatar

Oleksandr Shtalinberg shtalinberg

View GitHub Profile
# Django-ninja APIs (Python)
from ninja import Router, Schema
from django.http import JsonResponse
from django.contrib.auth import authenticate, login
from django.views.decorators.csrf import ensure_csrf_cookie
from django.contrib.auth.models import User
from ninja.errors import HttpError
router = Router()
@shtalinberg
shtalinberg / osx_developer_installation.rst
Created June 30, 2018 20:41 — forked from stefanfoulis/osx_developer_installation.rst
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@shtalinberg
shtalinberg / README.md
Created October 24, 2017 09:00 — forked from genomics-geek/README.md
Setting up a Dockerized web application with Django REST APIs, ReactJS with Redux pattern, and Webpack Hot Reloading! Mouthful.

Guide on how to create and set up a Dockerized web app using Django REST APIs and ReactJS

Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"

This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).

I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)

Main features:

  • Django REST APIs
@shtalinberg
shtalinberg / canonmp495.ppd
Created September 11, 2017 11:22
Modified Canon PPD file to allow grayscale printing, increased resolution and printing quality select
*PPD-Adobe: "4.3"
*% CUPS add-on PPD file for Canon Inkjet Printer Driver.
*% Copyright CANON INC. 2001-2010
*% All Rights Reserved.
*%
*% This program is free software; you can redistribute it and/or modify
*% it under the terms of the GNU General Public License as published by
*% the Free Software Foundation; version 2 of the License.
*%
*% This program is distributed in the hope that it will be useful,
@shtalinberg
shtalinberg / quick_punycode_encode_decode_example.py
Created January 20, 2016 11:41 — forked from floer32/quick_punycode_encode_decode_example.py
quick example of encoding and decoding a international domain name in Python (from Unicode to Punycode or IDNA codecs and back). Pay attention to the Unicode versus byte strings
# INCORRECT! DON'T DO THIS!
>>> x = "www.Alliancefrançaise.nu" # This is the problematic line. Forgot to make this a Unicode string.
>>> print x
www.Alliancefrançaise.nu
>>> x.encode('punycode')
'www.Alliancefranaise.nu-h1a31e'
>>> x.encode('punycode').decode('punycode')
u'www.Alliancefran\xc3\xa7aise.nu'
>>> print x.encode('punycode').decode('punycode')
www.Alliancefrançaise.nu