Skip to content

Instantly share code, notes, and snippets.

@EvilGoTa
EvilGoTa / gist:58bd1874779f1195cfde7835e5c46aae
Last active May 25, 2017 15:38
Webasyst простая отправка email
public static function mailSend($to, &$errors) {
if (!$to) {
$app_settings_model = new waAppSettingsModel();
$to = $app_settings_model->get('webasyst', 'email');
}
if (!$to) {
$errors['all'] = _ws('Recipient (administrator) email is not valid');
return false;
}
$email = waRequest::post('email');
@EvilGoTa
EvilGoTa / yandex-geocoder.js
Last active November 6, 2017 16:08
detect coordinates by address input from user
$('#yandex-location').autocomplete({
delay: 300,
source: function(request, responce) {
$.get('https://geocode-maps.yandex.ru/1.x/', {
geocode: request.term,
sizes: 5,
format: 'json'
}, function(data) {
var result = [];
data.response.GeoObjectCollection.featureMember.forEach(function(el, i) {
@EvilGoTa
EvilGoTa / ymaps_geoObjects.js
Created March 15, 2018 14:07
ymaps objectCollection, cluster, click events and more
function init(){
ymaps.geolocation.get({
// Зададим способ определения геолокации
// на основе ip пользователя.
provider: 'yandex',
// Включим автоматическое геокодирование результата.
autoReverseGeocode: true
}).then(function (result) {
// Выведем результат геокодирования.
console.log('--> Выведем результат геокодирования');