Skip to content

Instantly share code, notes, and snippets.

Настройки Atom. Синхронизация между несколькими устройствами.
Смотри плагин sync-settings, чтобы забрать себе все эти настройки. Или можно скачать эти файлы и заменить у себя в ~/.atom/
@zlojkashtan
zlojkashtan / t.js
Created August 11, 2017 12:28 — forked from h4/t.js
$(function() {
var $citySelect = $('#city-select'),
STORAGE_ITEM_NAME = 'saveCity';
$citySelect.on('change', function () {
var url = $citySelect.val();
if (url !== '') {
localStorage.setItem(STORAGE_ITEM_NAME, url);
window.location = url;
@zlojkashtan
zlojkashtan / script.js
Created October 21, 2015 22:36
Disable selection on document
/**
* Disable selection on document
*/
function preventSelection(element){
var preventSelection = false;
function addHandler(element, event, handler){
if (element.attachEvent)
element.attachEvent('on' + event, handler);
else
@zlojkashtan
zlojkashtan / 401-response.php
Last active August 29, 2015 14:28 — forked from clsource/401-response.php
Helper for Creating REST Web Services with ProcessWire
<?php
/*
* 401 Response
*
* Sends a 401 Response Unauthorized
*
* @author Camilo Castro
*
* @date 29/07/2014
@zlojkashtan
zlojkashtan / checkviewprot
Last active August 29, 2015 14:11
Check viewport
<script type="text/javascript">
if( navigator.userAgent.match(/iPad/i) != null ){
document.write('<meta name="viewport" content="width=1000, initial-scale=0.73, maximum-scale=1, user-scalable=1">');
} else if(navigator.userAgent.match(/iPhone/i) != null ) {
document.write('<meta name="viewport" content="width=320">');
} else {
document.write('<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">');
}
</script>
<?php
$out = '';
// create a new form field (also field wrapper)
$form = $modules->get("InputfieldForm");
$form->action = "./";
$form->method = "post";
$form->attr("id+name",'subscribe-form');
<?php
$start = $input->get->$from;
$start = $input->get->$from_name;
$start = $input->get->$to;
$start = $input->get->$to_name;
$subject = $input->get->subject;
$start = $input->get-> $message;
email_classic($from, $from_name, $to, $to_name, $subject, $message);
@zlojkashtan
zlojkashtan / Create Subscribers on PW
Last active August 29, 2015 14:00 — forked from manviny/Create Subscribers on PW
Создание списка подписчиков с проверкой на существование
<?php
/**
*
* Añade el cliente para Newsletters de un determinado municipio
* Si el cliente existe lo añade a la suscripcion del municipio seleccionado
* Si el cliente NO existe crea el usuario y la suscripcion
*
* IN: