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

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
@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));
@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
@amirrpp
amirrpp / postgres_queries_and_commands.sql
Last active September 10, 2019 09:30 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@amirrpp
amirrpp / ansible_local_playbooks.md
Created May 22, 2020 05:27 — forked from alces/ansible_local_playbooks.md
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local