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
: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, |
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
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() { |
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
#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 |
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 | |
use GuzzleHttp\Promise\Promise; | |
use GuzzleHttp\Promise\PromiseInterface; | |
/** | |
* Guzzle promise, which can get few params to functions and return few values. | |
* | |
* Class PromisePlus | |
*/ |
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
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 |
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
/* | |
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'; |
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
#!/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 | |
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
vhost_alias - модуль для апача. установить включить | |
dnsmasq установить | |
создать /etc/dnsmasq.d/local.com.conf с текстом address=/local.com/127.0.0.1 | |
В конфиг апача: | |
<VirtualHost *:80> | |
UseCanonicalName Off |
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
Всякие полезные команды | |
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 |
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
/** | |
* Скрипт создания форейн ключа $foreignKey в таблице $table1 на таблицу $table2. | |
* | |
* -Получаем все элементы таблицы1 и таблицы2. | |
* -Перебираем циклом элементы таблицы1 и проверяем существуют ли они в таблице2. | |
* -Если элемент в таблице2 не существует, удаляем ссылку на него из таблицы1. | |
* -Создаем форейн ключ в таблице1. | |
*/ | |
function validateTableAndCreateForeignKey($table1, $table2, $foreignKey) | |
{ |
NewerOlder