Skip to content

Instantly share code, notes, and snippets.

View amirrpp's full-sized avatar
🎯
Focusing

Amir Aziiev amirrpp

🎯
Focusing
  • Django Stars
  • Ukraine
View GitHub Profile
@amirrpp
amirrpp / config.json
Last active August 29, 2015 14:13 — forked from anonymous/config.json
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#0E7209, 6.5%)",
"@brand-success": "#21931c",
@amirrpp
amirrpp / meta.py
Created December 16, 2015 10:22 — forked from specialunderwear/meta.py
Override model fields of an abstract model baseclass in django, by removing them from the abstract model.
def AbstractClassWithoutFieldsNamed(cls, *excl):
"""
Removes unwanted fields from abstract base classes.
Usage::
>>> from oscar.apps.address.abstract_models import AbstractBillingAddress
>>> from koe.meta import AbstractClassWithoutFieldsNamed as without
>>> class BillingAddress(without(AbstractBillingAddress, 'phone_number')):
... pass
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix("http://habrahabr.ru"), url-prefix("http://geektimes.ru"), url-prefix("http://djbook.ru") {
#sidebar {
display: none;
}
.yui-t6 #yui-main .yui-b {
margin-right: 0;
}
.yui-t6 #yui-main .yui-b p,
.yui-t6 #yui-main .yui-b pre {

Changelog

v1.0

  • added russian error presentation (add Accept-Language: ru;q=1 in header of request);
  • removed [] from error value;
  • changed error keys: non_field_errors -> error, detail -> error;

v1.1

  • changed error translation in documentation;
  • added admin panel link to docs;
  • added online-lesson descr in docs;
@amirrpp
amirrpp / friggReadme.md
Created September 28, 2016 12:13 — forked from m-bo-one/friggReadme.md
frigg(cloudapp) API description

Changelog

v2.0

  • Restructured back-end part of project - moved on web api;
  • removed banner section;
  • removed get latest video and text lessons section;
  • changed some parts of api (see all sections which key is changed/removed):
    • patronymic -> middle_name;
    • photo -> image;
    • text -> description (not in all parts);
@amirrpp
amirrpp / start_docker_registry.bash
Created June 15, 2017 13:04 — forked from PieterScheffers/start_docker_registry.bash
Start docker registry with letsencrypt certificates (Linux Ubuntu)
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
from django.db import models
class AbstractSeoContent(models.Model):
h1 = models.CharField('H1', max_length=255, blank=True)
meta_title = models.CharField(_('Title for page'), max_length=255, blank=True)
meta_description = models.CharField(max_length=255, blank=True)
meta_canonical = models.CharField(max_length=255, blank=True)
meta_keywords = models.CharField(max_length=255, blank=True)
meta_robots = models.CharField(max_length=255, blank=True)
@amirrpp
amirrpp / postgresql-set-id-seq.sql
Created March 29, 2018 14:05 — forked from henriquemenezes/postgresql-set-id-seq.sql
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
#!/bin/bash
cat <<EOT > /etc/default/locale
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LC_TYPE=en_US.UTF-8
EOT
locale-gen en_US.UTF-8
@amirrpp
amirrpp / serve.go
Created April 17, 2018 06:47 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main