Skip to content

Instantly share code, notes, and snippets.

Maxim Ishchenko maximishchenko

Block or report user

Report or block maximishchenko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maximishchenko
maximishchenko / php_GDImageFill.php
Last active Jul 9, 2017
PHP Fill or Fit Image (based on gd library)
View php_GDImageFill.php
<?php
namespace common\widgets;
/**
* Crop fill or fit image with php-gd library
* @author Maxim Ishchenko <maxim.ishchenko@gmail.com>
* @version 1.0*
* @uses, @example
* @license GPL
View StringOperations.php
<?php
/**
*
*/
class StringOperations
{
public function Transliterate($str) {
$translit=array(
"А"=>"a","Б"=>"b","В"=>"v","Г"=>"g","Д"=>"d","Е"=>"e","Ё"=>"e","Ж"=>"zh","З"=>"z","И"=>"i","Й"=>"y","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n","О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t","У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"ts","Ч"=>"ch","Ш"=>"sh","Щ"=>"shch","Ъ"=>"","Ы"=>"y","Ь"=>"","Э"=>"e","Ю"=>"yu","Я"=>"ya",
@maximishchenko
maximishchenko / GoogleMaps.php
Last active May 19, 2017
Download Google Maps Image by Coordinates
View GoogleMaps.php
<?php
/**
* Get Image from Google Maps API by place coordinates and download it.
* @author Maxim Ishchenko <maxim.ishchenko@gmail.com>
* @version 1.0*
* @uses
*
* $map = new GoogleMaps(
* array(
@maximishchenko
maximishchenko / YoutubeThumbs.php
Created May 8, 2017
Download Youtube Thumbnail
View YoutubeThumbs.php
<?php
/**
* Get Preview Image from Youtube video link (not from embeded code) and download it if video exist
* @author Maxim Ishchenko <maxim.ishchenko@gmail.com>
* @version 1.0*
* @uses
*
* $getThumbs = new YoutubeThumbs('https://youtu.be/xxxxxxxxxxx', 'quality', 'directory');
* echo '<img src="'.$getThumbs->getThumbnail().'"/>';
@maximishchenko
maximishchenko / js_classesManipulation.js
Last active Oct 16, 2016
Javascript: добавление, удаление, переключение классов элемента
View js_classesManipulation.js
/**
* @author [Maxim Ishchenko <maxim.ishchenko@gmail.com>]
* @param {[string]} [title] [Набор методов для добавления, удаления, переключения класса элемента]
* [classesManipulation содержит набор методов для добавления/удаления классов элемента, в случае его наличия]
* @return {[none | false]} [производит указанный набор манипуляций с классами элемента в случае его наличия]
* @example
* // добавить скрипт на страницу:
* script type="text/javascript" src="path/to/this/script"
* // объявить класс:
* var classesManipulation = new classesManipulation();
@maximishchenko
maximishchenko / yii2_proceedGridviewCheckBoxes.js
Created Aug 17, 2016
yii2_proceedGridviewCheckBoxes.js
View yii2_proceedGridviewCheckBoxes.js
// included script. For example js/gridViewProceedCheckBoxes.js
/**
* [proceedCheckBoxes description]
* @param {[type]} btnID [id of button]
* @param {[type]} gridID [id of GridView]
* @param {[type]} pjaxID [id of pjax-container]
* @param {[type]} emptyAlertText [text for alert "Nothing Checked"]
* @param {[type]} confirmAlertText [text for confirmation alert]
* @param {[type]} proceedURL [controller action ro proceed]
View js_toggleDivOnclick.js
/**
* [toggleDiv onButtonClick hide/show selected div]
* @param {[type]} btnID [id of button]
* @param {[type]} divID [id of div]
* @return {[string]}
*/
function toggleDiv(btnID, divID) {
/**
* Get button element from ID
@maximishchenko
maximishchenko / js_previewImageBeforeUpload.html
Last active Aug 14, 2016
JavaScript Preview Image Before Upload
View js_previewImageBeforeUpload.html
<script type="text/javascript">
/**
* Display image selected in html input widget
* @param {string} inputID id of html image input
* @param {string} imgFieldID id of html img tag
* @return none
*/
function previewImageBeforeUpload(inputID, imgFieldID) {
View outlookAttachSizeLimit.reg
# HKEY_CURRENT_USER\Software\Microsoft\Office\<officeVersion>\Outlook\Preferences\MaximumAttachmentSize
#
# Создать указанный раздел. Указать размер в кб (для отключения - 0)
#
# <officeVersion> - версия офисного пакета:
# 2007 - 12.0
# 2010 - 14.0
# 2014 - 15.0
#
# Пример:
View activeDirectoryResetTrustWithWorkstation.cmd
# in DC
netdom reset <computerName> /domain <domainName> /Usero <userName> /Passwordo <password>
# in Workstation
nltest /server:<computerName> /sc_reset:<domainName>\<DCName>
# test
nltest /query
You can’t perform that action at this time.