Skip to content

Instantly share code, notes, and snippets.

View Adoonq's full-sized avatar
🏠
Working from home

Ihor Kladko Adoonq

🏠
Working from home
View GitHub Profile
<?php
$user=array(
'USER_LOGIN'=>'',
'USER_HASH'=>''
);
$subdomain='';
curl_amocrm($user, $subdomain, 'private/api/auth.php?type=json');
@Adoonq
Adoonq / subscribe.php
Created December 10, 2018 14:47
Sendpulse add email
<?php
$access_data = array(
'grant_type' => 'client_credentials',
'client_id' => '478f545c4124c737ce7e05a2534c1342',
'client_secret' => 'c034ff43f6b298b2d0bcf40ef7ca9d46',
);
$token = sendRequest('oauth/access_token', $access_data, false);
@Adoonq
Adoonq / youtube-video.css
Last active November 2, 2018 11:46
YouTube VideoBackground
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
@media (min-aspect-ratio: 16/9) {height: 300%; top: -100%}
@media (max-aspect-ratio: 16/9) {width: 300%; left: -100%}
}
@Adoonq
Adoonq / formit-ajax.js
Last active November 2, 2018 11:47
Modx FormIt Ajax - событие отправки
$(document).on('af_complete', function(event, response) {
var form = response.form;
if (response.success) {
form.trigger('reset');
}
});
@Adoonq
Adoonq / wp_replace-domain.txt
Last active January 17, 2019 11:51
Замена ссылок при переносе сайта WordPress
UPDATE wp_options SET option_value = replace(option_value, 'http://domain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://domain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://domain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://domain.com','http://newdomain.com');
@Adoonq
Adoonq / info.txt
Last active February 10, 2021 11:27
Кастомные поля для комментариев (Tickets Modx)
/* Плагин с событием на OnBeforeCommentSave
https://modx.pro/help/4370
https://bezumkin.ru/sections/522/1540/ */
if ($modx->event->name == 'OnBeforeCommentSave') {
if(!empty($_POST['my_property_prop'])){
$properties = array(
'my_property' => $modx->stripTags($_POST['my_property_prop'])
);
} else {
@Adoonq
Adoonq / numFormat.js
Last active July 6, 2018 07:40
Разделение разрядов числа пробелами
var str = "3830000";
alert(str.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 '));
@Adoonq
Adoonq / :hover for iphone
Last active February 17, 2018 14:01
IPhone Hover
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
$('a').click(function() {});
}
@Adoonq
Adoonq / detectCountry.js
Last active May 26, 2018 05:37
Определение страны по ip пользователя
$.getJSON('https://ipinfo.io', function(data){
if(data) {
switch (data.country) {
case 'UA': alert('Ukraine');
break;
case 'RU': alert('Russia');
break;
default:
@Adoonq
Adoonq / modality.css
Last active December 22, 2016 20:51
Modality
body.modality-on {
overflow: hidden;
}
body.modality-on .modality--open {
overflow-y: auto;
}
.modality {
position: fixed;
top: 0;