Skip to content

Instantly share code, notes, and snippets.

View Rachind's full-sized avatar

rachind Rachind

  • Webservice
  • Saint-Petersburg, Russia
View GitHub Profile
@Rachind
Rachind / placeholder-color.css
Last active June 6, 2016 15:33
Placeholder color
::-webkit-input-placeholder {color:#c0392b;}
::-moz-placeholder {color:#c0392b;}
:-moz-placeholder {color:#c0392b;}
:-ms-input-placeholder {color:#c0392b;}
@Rachind
Rachind / jquery.maskedinput.min.js
Last active March 4, 2019 08:05
jQuery Masked Input Plugin
/*
jQuery Masked Input Plugin
Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.4.1
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b,c=navigator.userAgent,d=/iphone/i.test(c),e=/chrome/i.test(c),f=/android/i.test(c);a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},a.fn.extend({caret:function(a,b){var c;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof a?(b="number"==typeof b?b:a,this.each(function(){this.setSelectionRange?this.setSelectionRange(a,b):this.createTextRange&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select())})):(this[0].setSelectionRange?(a=this[0].selectionStart,b=this[0].selectionEnd):document.selection&&document.selection.createRange&&(c=documen
@Rachind
Rachind / css-text-two-columns.css
Created June 6, 2016 17:31
CSS Text Two Columns
.text-columns {
width:100%; /*указываем общую ширину блока с колонками*/
text-align:left; /*выравнивание текста внутри колонок*/
column-width: 570px; /*указываем ширину колонок*/
-moz-column-width: 570px;
-webkit-column-width: 570px;
column-gap: 30px; /*отступ между колонками*/
-moz-column-gap: 30px;
-webkit-column-gap: 30px;
}
@Rachind
Rachind / javascript.download-file.js
Created June 7, 2016 10:16
Javascript Download File
window.downloadFile = function (sUrl) {
//iOS devices do not support downloading. We have to inform user about this.
if (/(iP)/g.test(navigator.userAgent)) {
alert('Your device does not support files downloading. Please try again in desktop browser.');
return false;
}
//If in Chrome or Safari - download via virtual link click
if (window.downloadFile.isChrome || window.downloadFile.isSafari) {
@Rachind
Rachind / snippet.setlocale.php
Created June 9, 2016 07:29
Snippet setLocale
<?php
setlocale(LC_ALL, "ru_RU.UTF-8");
@Rachind
Rachind / snippet.nl2li.php
Created June 9, 2016 07:33
Snippet nl2li
<?php
$list = explode ("\n",$input);
foreach($list as $v) echo '<li>'.trim($v).'</li>';
@Rachind
Rachind / snippet.rudate.php
Last active February 10, 2019 20:05
Snippet ruDate
<?php
//20 февраля 2014 г.
//date_format
$mounth = array('января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря');
return date("d", $input).' '.$mounth[date("n", $input)-1].' '.date("Y", $input).' г.';
@Rachind
Rachind / modx.error-log.php
Created June 9, 2016 07:35
MODX Error Log
<?
$modx->log(modX::LOG_LEVEL_ERROR, $error);
@Rachind
Rachind / convert-evo-to-gallery.php
Last active December 27, 2016 18:38
MODX Convert Evogallery to Gallery
@Rachind
Rachind / snippet-resourceList.php
Last active July 15, 2016 07:07
Snippet resourcesList
<?php
// сниппет resourcesList
// можно формировать по parent и по template
// в возможных значениях tv: @EVAL return $modx->runSnippet('resourcesList', array('template'=>17));
$q = $modx->newQuery('modResource');
$q->select(array(
'modResource.id as id',