Skip to content

Instantly share code, notes, and snippets.

View gaintsev's full-sized avatar
🎯
Focusing

gaintsev gaintsev

🎯
Focusing
View GitHub Profile
@gaintsev
gaintsev / gist:a7a79b4644e656ad8096102880d82a70
Created March 16, 2021 11:10 — forked from Neolot/gist:3964380
PHP Склонение числительных
<?php
/**
* Функция склонения числительных в русском языке
*
* @param int $number Число которое нужно просклонять
* @param array $titles Массив слов для склонения
* @return string
**/
$titles = array('Сидит %d котик', 'Сидят %d котика', 'Сидит %d котиков');
function declOfNum($number, $titles)
@gaintsev
gaintsev / howtofix.md
Created February 26, 2020 05:12
Неверное время в Windows, при использовании двух систем (Windows / Linux)
  1. В Windows запустить командную строку от имени администратора и выполнить:
reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1

данный параметр позволяет переключить Windows на использование времени в формате UTC.

  1. Затем отключить обновление времени из Интернета, т.к. служба времени Windows при каждом обновлении времени будет сбрасывать UTC время на локальное:
@gaintsev
gaintsev / fix.md
Created September 3, 2019 11:59
Firefox context menu right-click problem
@gaintsev
gaintsev / gist:132b42dfe309b3cb91453441e2692547
Created September 2, 2019 11:01 — forked from poliveira89/gist:5966434
How to use WebDav on Linux+XFCE+Thunar
davs://poliveira@some.webserver.pt/webdav/someFolder
@gaintsev
gaintsev / example.html
Last active January 23, 2023 06:56
ss-user-utm
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>ss-utm</title>
</head>
<body data-ss-user-utm>
<form action="?" method="post">
<input data-ss-user-utm-source type="text" name="utm_source" value="">
<form action="handler.php" method="post" target="_blank">
<div class="form-group">
<label for="name">Ваше имя:</label>
<input id="name" name="name" type="text" placeholder="Иван Иванов" required>
</div>
<div class="form-group">
<label for="custom_field[144735]">Номер телефона:</label>
<input id="phone" type="text" name="custom_field[144735]" required>
Array
(
[name] => Владимир
[custom_field] => Array
(
[144735] => +79371234567
[144737] => test@gmail.com
[242955] => Не работаю
)
<form
id="ss-form"
action="https://amocrm.sellskill.ru/index.php"
method="post"
target="_blank"
data-ss-user-data
onsubmit="document.getElementById('ss-form-button').disabled=true;"
>
<!-- user data -->
<div class="ss-field-group">
@gaintsev
gaintsev / gist:f498b5b335f386ad86a5296bbccd0366
Created February 19, 2019 08:51
Firefox disable button delay on the download dialog
1. about:config
2. security.dialog_enable_delay
3. set value = 0
@gaintsev
gaintsev / README.md
Last active August 28, 2018 17:28 — forked from DamonOehlman/README.md
Provisioning of node + nginx designed for use with vagrant shell provisioner. No need for chef, puppet.

This is a simple shell script that is designed to provision both nginx and node on your machine. I primarily wrote it for use with Vagrant and an example Vagrantfile is included in the Gist as well.