Skip to content

Instantly share code, notes, and snippets.

@IlyaZha
IlyaZha / tlscontact-small.css
Last active June 6, 2023 08:14
tlscontact small screen
:root {
--slot-height: 31px;
}
#timeTable div.take_appointment {
/* width: 1200px;*/
width: fit-content;
}
header .container, .overlapping-lg-card.card-with-bars, td.done, tr.done, #ajax_form_status #center,
@IlyaZha
IlyaZha / tlscontact.js
Created June 6, 2023 07:29
tlscontact JS
const audio = new Audio();
// Set the source of the audio file
audio.src = 'http://commondatastorage.googleapis.com/codeskulptor-assets/week7-brrring.m4a';
const audio2 = new Audio();
// Set the source of the audio file
audio2.src = 'http://commondatastorage.googleapis.com/codeskulptor-assets/Collision8-Bit.ogg';
function makeAttention() {
@IlyaZha
IlyaZha / tlscontact.css
Created June 6, 2023 07:27
tlscontact CSS
#timeTable div.take_appointment {
/* width: 1200px;*/
width: fit-content;
}
header .container, .overlapping-lg-card.card-with-bars, td.done, tr.done, #ajax_form_status #center,
/* .inner_timeslot:nth-child(-n+5), */
table div.take_appointment .year-month-title,
table div.take_appointment br,
tr.pending
<?php
use GuzzleHttp\Promise\Promise;
use GuzzleHttp\Promise\PromiseInterface;
/**
* Guzzle promise, which can get few params to functions and return few values.
*
* Class PromisePlus
*/
find ./ -name "*.jpg" -size +600k -printf '%p %s ' //find images bigger than 600Kb
find ./ -name "*.jpg" -size +800k -exec convert -resize 1920x {} {} \; //resize images
find ./ -name "*.jpg" -size -330k -exec jpegoptim --all-progressive --strip-all '{}' \; //progressive optimization
find ./ -name "*.jpg" -size +330k -exec jpegoptim -S 330K --all-progressive --strip-all '{}' \; //max size 330K
@IlyaZha
IlyaZha / code.js
Created September 19, 2018 08:50
Копирование стиля с одного элемента на другой Copying style from one element to another
/*
mainElement - the element from which we copy styles
secondElement - element to which we apply styles
Code works similar in Chrome and Firefox. I haven't tested it in Safary
*/
//If button is hidden, styles are copying badly. So we show main element
var display = mainElement.style.display;
mainElement.style.cssText = 'display:block!important';
@IlyaZha
IlyaZha / Install_WebStorm.sh
Last active October 2, 2018 16:05 — forked from almirb/Install_Phpstorm.sh
Update webstorm on Ubuntu linux.
#!/bin/bash -e
# Original credits to theodorosploumis
# IMPORTANT. My webstorm installation exists on /opt/webstorm.
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
vhost_alias - модуль для апача. установить включить
dnsmasq установить
создать /etc/dnsmasq.d/local.com.conf с текстом address=/local.com/127.0.0.1
В конфиг апача:
<VirtualHost *:80>
UseCanonicalName Off
Всякие полезные команды
0 4 * * * mysqldump -uroot -p database --ignore-table=database.core_url_rewrite | gzip > `date +database.%Y%m%d.%H%M%S.sql.gz`
0 4 * * * find /backups -type f -mtime +30 -print0 | xargs -0 rm -f
tar -pczvf archive.tar.gz --exclude={'*.avi','*.jpg','*.png','*.jpeg','*.gif'} /path/to/dir
sed -ie 's/ROW_FORMAT=FIXED//g' newdump.sql
select * from cron_schedule where created_at like '2017-05%' GROUP BY job_code
Найти базу и скопировать из огромного файла:
sed -n '/^-- Current Database: `itspurt_shopify_instockreminder`/,/^-- Current Database: `/p' 2016-03-01.sql > isr2016-03-01.sql
@IlyaZha
IlyaZha / gist:41dc95c2184db5f65695f1092599a5bb
Last active January 17, 2017 11:54
Creating and dropping foreign keys
/**
* Скрипт создания форейн ключа $foreignKey в таблице $table1 на таблицу $table2.
*
* -Получаем все элементы таблицы1 и таблицы2.
* -Перебираем циклом элементы таблицы1 и проверяем существуют ли они в таблице2.
* -Если элемент в таблице2 не существует, удаляем ссылку на него из таблицы1.
* -Создаем форейн ключ в таблице1.
*/
function validateTableAndCreateForeignKey($table1, $table2, $foreignKey)
{