Skip to content

Instantly share code, notes, and snippets.

View maxcraftsman's full-sized avatar
🎯
Focusing

Maxim Tatarinov maxcraftsman

🎯
Focusing
View GitHub Profile
@maxcraftsman
maxcraftsman / tools.py
Last active March 28, 2021 00:28
Usefull tools
#loger
with open("/pavuki/doska/files/desk.log", "a", encoding='utf-8') as d:
d.write("Was runned at " + timenow.strftime("%d.%m.%Y %H:%M:%S"))
d.write('\n')
#generate array of dates
def generateRange(start,end):
global dateRange
dateRange = []
@maxcraftsman
maxcraftsman / date_gen.py
Last active July 20, 2020 05:01
Python cookbook
from datetime import date, datetime, timedelta
from calendar import monthrange
import pytz
dateRange = []
curTime = datetime.now()
def generateRange(start,end):
for y in range(start,end):
for m in range(1,13):
@maxcraftsman
maxcraftsman / dategen.py
Created July 20, 2020 04:54
Date array generator
from datetime import date, datetime, timedelta
from calendar import monthrange
import pytz
dateRange = []
curTime = datetime.now()
def generateRange(start,end):
for y in range(start,end):
for m in range(1,13):
@maxcraftsman
maxcraftsman / pd_to_sql.py
Last active July 7, 2020 12:07
Save pandas to sqlite [dirty]
import pandas as pd
import sqlalchemy as sa
e = sa.create_engine(r'sqlite:////path/to/file/database.db', echo=True) # LINUX
e = sa.create_engine(r'sqlite:///C:\\path\\to\\database.db', echo=True) # WINDOWS
df.to_sql("deskykt", e, if_exists="append", index=False)
@maxcraftsman
maxcraftsman / script.py
Created July 7, 2020 11:46
Example of date column replace by function and change depending of the conditions [dirty]
import csv
import pandas as pd
import shutil
import pymysql
import sys
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
import sqlalchemy as sa
import pytz
<style>
.catalog-list {
font-family: Arial;
float: left;
width: 33%;
list-style: none;
padding: 0;
margin: 20px 0 35px;
padding-left: 65px;
position: relative;
$APPLICATION->SetTitle("Ваш титл");
@maxcraftsman
maxcraftsman / select2-scroll.css
Last active September 26, 2024 17:52
select2 scrollbar styles
.select2-results__options::-webkit-scrollbar {
width: 16px;
background-clip: padding-box;
}
.select2-results__options::-webkit-scrollbar-track {
background-color: #F4F4F4;
height: 8px;
background-clip: padding-box;
border-right: 10px solid rgba(0, 0, 0, 0);
border-top: 10px solid rgba(0, 0, 0, 0);
@maxcraftsman
maxcraftsman / PackMenu.js
Created May 24, 2018 08:02
adaptive menu
function PackMenu(){
var menu = '#adaptive-menu';
$("#ext-menu").hide();
$(menu).append($("#ext-menu .ext-menu>li"));
while($(menu + ">li:last").position().top > $(menu).position().top){
$("#ext-menu .ext-menu").prepend($(menu + ">li:last"));
$("#ext-menu").show();
};
}
$(window).on("resize", function() {
<section class="section_default container">
<h3 class="underlined">Запчасти</h3>
<div class="text-fw f20">Подберите самостоятельно нужные Вам комплектующие запчасти<br>или <a data-toggle="orderModal" class="link">оставьте нам заявку</a>!</div>
<form action="" class="find-gears" id="findGears">
<select name="brand" id="selectBrand" placeholder="Бренд трактора" required>
<option></option>
<option value="1">Бренд 1</option>
<option value="dva">Бренд 2</option>
<option value="3tri">Бренд 3</option>
<option value="4">Бренд 4</option>