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
| createAxiosResponseInterceptor() { | |
| const interceptor = axios.interceptors.response.use( | |
| response => response, | |
| error => { | |
| // Reject promise if usual error | |
| if (errorResponse.status !== 401) { | |
| return Promise.reject(error); | |
| } | |
| /* |
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
| import requests | |
| from bs4 import BeautifulSoup | |
| resp = requests.get("http://static.feed.rbc.ru/rbc/logical/footer/news.rss") | |
| soup = BeautifulSoup(resp.content) | |
| items = soup.findAll('item') | |
| for item in items: | |
| print(item.title.text.replace("<![CDATA[", "").replace("]]>", "")) |
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
| version: '2' | |
| services: | |
| djangoapp: | |
| container_name: djangoapp_python | |
| build: | |
| context: . | |
| dockerfile: docker/djangoapp/Dockerfile | |
| command: gunicorn gaz.wsgi:application --bind 0.0.0.0:8000 | |
| restart: always |
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
| App theme: Material Arc Dark [https://plugins.jetbrains.com/plugin/8006-material-theme-ui/] | |
| Code theme: Monokai Sublime Text 3 [http://color-themes.com/?view=theme&id=563a1a7680b4acf11273ae94] | |
| Font: Source Code Pro | |
| Plugins: | |
| - CodeGlance | |
| - .env | |
| Settings: | |
| - Password: In KeePass |
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
| // Version 1.0+ | |
| export const leaflet_russian = () => { | |
| L.drawLocal = { | |
| draw: { | |
| toolbar: { | |
| actions: { | |
| title: 'Прекратить рисование',//'Cancel drawing', | |
| text: 'Отмена' | |
| }, | |
| finish: { |
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
| axios.interceptors.response.use( | |
| response => response, | |
| error => { | |
| const originalRequest = error.config; | |
| // EXPIRED TOKEN | |
| if (error.response.status === 401 && error.response.data.code === "token_not_valid") { | |
| originalRequest._retry = true; | |
| store.dispatch('AUTH_REFRESH_TOKEN', { |
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
| #~ | |
| let a = { | |
| meta: { | |
| requiresAuth: true, | |
| userAuth: true, | |
| adminAuth: true | |
| } | |
| }; |
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
| <?php | |
| $arr = [ | |
| [ | |
| 'cat' = > [ | |
| 'id' => 0, | |
| 'name' => 'Cat1' | |
| ], | |
| 'posts':[ | |
| [ | |
| 'id': 1, |
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
| #! /usr/bin/python | |
| import os | |
| import re | |
| import subprocess | |
| # 0 - sub | |
| # 1 - headphones | |
| status =0 | |
| regex = r": values=(.+)" |
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
| #Insall Ajenti ubuntu 18.04 | |
| apt-get update | |
| wget http://repo.ajenti.org/debian/key -O- | apt-key add - | |
| echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list | |
| apt-get update | |
| # install python imaging | |
| apt upgrade | |
| apt-get install python-pillow | |
| cd ~ | |
| wget http://security.ubuntu.com/ubuntu/pool/universe/p/pillow/python-imaging_4.1.1-3build2_all.deb |