Skip to content

Instantly share code, notes, and snippets.

View shmidtelson's full-sized avatar
💻
I do so as much as i can

Roman Sapezhko shmidtelson

💻
I do so as much as i can
View GitHub Profile
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
@shmidtelson
shmidtelson / settings.yml
Last active August 10, 2019 10:22
Settings for Jetbrains IDE by Romua1d
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
@shmidtelson
shmidtelson / leaflet.draw.js
Last active August 7, 2019 13:03
Leaflet.draw Russian language
// Version 1.0+
export const leaflet_russian = () => {
L.drawLocal = {
draw: {
toolbar: {
actions: {
title: 'Прекратить рисование',//'Cancel drawing',
text: 'Отмена'
},
finish: {
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', {
#~
let a = {
meta: {
requiresAuth: true,
userAuth: true,
adminAuth: true
}
};
<?php
$arr = [
[
'cat' = > [
'id' => 0,
'name' => 'Cat1'
],
'posts':[
[
'id': 1,
@shmidtelson
shmidtelson / gist:18112efbd1c10e3e76ef77b1b77c8f9d
Created April 6, 2019 11:23
Asus xonar DGX force switch FRONT and BACK output [manjaro KDE]
#! /usr/bin/python
import os
import re
import subprocess
# 0 - sub
# 1 - headphones
status =0
regex = r": values=(.+)"
@shmidtelson
shmidtelson / ajenti-v-php7.3.sh
Last active August 21, 2021 02:47 — forked from kn9/ajenti-v-php7.sh
Ubuntu Nginx Web Server with Ajenti with PHP 7.3
#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
var cheerio = require('cheerio'),
needle = require('needle'),
tress = require('tress'),
resolve = require('url'),
fs = require('fs');
var targetURL = 'https://icobench.com/icos';
var results = [];
var get_data = function (url, callback) {
needle.get(url, function (err, res) {
@shmidtelson
shmidtelson / sc-admin.php
Last active December 8, 2018 11:03
Fixed cyrillic shortcode names in edit function. Problem with '+' in urls
<?php
class Shortcoder_Admin{
private static $pagehook = 'settings_page_shortcoder';
public static function init(){
// Add menu
add_action( 'admin_menu', array( __class__, 'add_menu' ) );