Skip to content

Instantly share code, notes, and snippets.

pelid /
Last active Mar 26, 2020
Скрипт для копирования кода с GitHub
alvarocavalcanti /
Last active May 12, 2020
Configuring Python Remote Interpreter using Docker
FROM python:3.7
# Copying the requirements, this is needed because at this point the volume isn't mounted yet
COPY requirements.txt /code/
# Installing requirements, if you don't use this, you should.
# More info:
AndrewPix /
Last active Aug 31, 2020
Integrate django-rest-knox with django-rest-auth
from rest_framework import serializers
from rest_auth.serializers import UserDetailsSerializer
class KnoxSerializer(serializers.Serializer):
Serializer for Knox authentication.
token = serializers.CharField()
Cediddi /
Created Mar 11, 2017
django_extensions' shell_plus for Pycharm's django console
from import import_objects
from import no_style
globals().update(import_objects({"dont_load":[], "quiet_load":False},no_style()))
View gist:70bade805990867915cdf825c7d8879f
# Start simple SMTP server on localhost:25 and print to standard output all email headers and the email body.
# Useful for debugging outgoing mail without configuring SMTP daemon in development enviroment.
python -m smtpd -n -c DebuggingServer localhost:25
GeyseR / py codestyle clarification
Last active Sep 1, 2020 — forked from dcramer/
Python Standards(that I would change and enforce if I could)
View py codestyle clarification
# file for git rename
neuroticnerd /
Last active Jul 27, 2018
Python 2.7.9 on Ubuntu 14.04.2 (without overwriting original version)
#! /usr/bin/env bash
# install dependencies
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
davisford / gist:5039064
Last active Oct 13, 2020
git clone into non-empty directory
View gist:5039064

Let's say you start a project locally, and do some editing.

$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE

Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:

joaopizani / .screenrc
Created May 17, 2012
A killer GNU Screen Config
View .screenrc
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
You can’t perform that action at this time.