This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://codesandbox.io/s/elastic-water-u7njqk?file=/src/App.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo echo ' | |
stream { | |
upstream postgres { | |
server localhost:5432; | |
} | |
server { | |
listen 5432 so_keepalive=on; | |
proxy_pass 999.999.999.999:5432; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{#Example of use:#} | |
{#def render_my_page(request, mark_id)#} | |
{# context = {#} | |
{# 'breadcrumb': [ # This it!#} | |
{# ("Все Марки:", reverse('cars')), # with url#} | |
{# (f"Марка: {data['name']}",) # simple text#} | |
{# ],#} | |
{# 'id': mark_id, # custom id#} | |
{# }#} | |
{# return render(request, 'pages/my_page.html', context=context)#} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM postgres:13.3 | |
COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance | |
RUN chmod +x /usr/local/bin/maintenance/* | |
RUN mv /usr/local/bin/maintenance/* /usr/local/bin \ | |
&& rmdir /usr/local/bin/maintenance | |
ARG DEBIAN_FRONTEND=noninteractive | |
ARG ES_VERSION=7.13.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM postgres:13.2 | |
ARG MONGO_FDW_VERSION=5_2_8 | |
ARG MONGO_FDW_URL=https://github.com/EnterpriseDB/mongo_fdw/archive/REL-${MONGO_FDW_VERSION}.tar.gz | |
ARG SOURCE_FILES=tmp/mongo_fdw | |
RUN apt-get update | |
RUN apt-get install -y --no-install-recommends wget ca-certificates make gcc cmake pkg-config postgresql-server-dev-13 libssl-dev libzstd-dev libtool | |
RUN mkdir -p ${SOURCE_FILES} && wget -O - ${MONGO_FDW_URL} | tar -zx --strip-components=1 -C ${SOURCE_FILES} | |
RUN cd ${SOURCE_FILES} && ./autogen.sh --with-master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$IFDEF FPC} | |
{$mode delphi} | |
{$ENDIF} | |
unit KOLHTTPDownload; | |
{ | |
("`-''-/").___..--''"`-._ | |
`6_ 6 ) `-. ( ).`-.__.`) | |
(_Y_.)' ._ ) `._ `. ``-..-' | |
_..`--'_..-_/ /--'_.' ,' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can easy add PostGis following few simple steps: | |
1. add to `compose\production\django` samewhere in `RUN apt-get update \` | |
```bash | |
&& apt-get install -y gdal-bin \ | |
``` | |
2. edit `compose\production\postgres` | |
change | |
`FROM postgres:12.3` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tested on Chrome 75 | |
function donwloads_status() { | |
let tag = document.querySelector('downloads-manager').shadowRoot; | |
let item_tags = tag.querySelectorAll('downloads-item'); | |
let items_count = item_tags.length; | |
let progress_lst = []; | |
for (let i = 0; i < items_count; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH avaliable_phones AS ( | |
SELECT | |
pn.id as id, | |
-- rank() over (partition by pn.id order by pn.id) as rank, | |
count(pn.id) over (partition by pn.id order by pn.id) as phones_count, | |
-- getprice(c.id, s.id) price, | |
c.id as country_id, | |
c.slug as country_slug, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set session my.vars.user_id = 0; -- not entered | |
set session my.vars.user_id = 1;-- entered, user.id=1 | |
select | |
* | |
from | |
services sv | |
-- favorite, (join only if user.id > 0) | |
LEFT JOIN |