Skip to content

Instantly share code, notes, and snippets.

Avatar

Artem Ulko ulkoart

  • Russia, Krasnodar
View GitHub Profile
@jmn
jmn / django_pagination_bootstrap4
Created Aug 28, 2017
Django pagination controls for Bootstrap 4
View django_pagination_bootstrap4
{% if is_paginated %}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-left">
{% if page_obj.has_previous %}
<li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">&laquo;</a></li>
{% else %}
<li class="page-item disabled"><a class="page-link" href="#"><span>&laquo;</span></a></li>
{% endif %}
{% for i in paginator.page_range %}
{% if page_obj.number == i %}
@denji
denji / README.md
Last active Sep 19, 2021 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
View README.md
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@Highstaker
Highstaker / secondsToText.py
Last active Jan 5, 2021
secondsToText with pluralization (days, hours, minutes, seconds) in several languages: English, German, Spanish and Russian.
View secondsToText.py
def pluralizeRussian(number, nom_sing, gen_sing, gen_pl):
s_last_digit = str(number)[-1]
if int(str(number)[-2:]) in range(11,20):
#11-19
return gen_pl
elif s_last_digit == '1':
#1
return nom_sing
elif int(s_last_digit) in range(2,5):
@subfuzion
subfuzion / curl.md
Last active Sep 18, 2021
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@kimus
kimus / cx_oracle.md
Last active Sep 19, 2021
Installing python cx_oracle on Ubuntu
View cx_oracle.md

First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.

Linux

Step 1:

sudo apt-get install build-essential unzip python-dev libaio-dev

Step 2. Click here to download the appropriate zip files required for this. You'll need: