Skip to content

Instantly share code, notes, and snippets.

@Ambalus
Ambalus / php7.sh
Created November 22, 2015 07:19 — forked from jzumbrun/php7.sh
php7
sudo apt-get remove php5*
git clone https://github.com/kasparsd/php-7-debian.git
cd php-7-debian
./build.sh
./install.sh
sudo rm -Rf php-7-debian/
cd /usr/local/php7/bin
function xml2json($xmlString){
$fileContents = str_replace(["\n", "\r", "\t"], '', $xmlString);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml,JSON_UNESCAPED_UNICODE);
return $json;
}
@Ambalus
Ambalus / SetIBlockAdminListDisplaySettings.php
Created November 20, 2015 14:19 — forked from mesilov/SetIBlockAdminListDisplaySettings.php
Программная настройка столбцов списка элементов ИБ в админке инфоблоков для bitrix
/**
* Настройка столбцов списка элементов ИБ в админке инфоблоков
*
* @param integer $IBlockID — ID инфоблока
* @param string $arIBlockListAdminColumns — символьные коды полей и свойств для показа в списке элементов ИБ
* @param string $orderByColumnName — наименования поля или свойства по которому нудно отсортировать
* @param string $orderDirection - направление сортировки
* @param integer $pageSize - количество элементов на страницу
* @param boolean $isToAllUsers - значение будет для всех, или для текущего пользователя
* @return boolean
@Ambalus
Ambalus / clariondate.sql
Last active November 27, 2015 15:57 — forked from fushnisoft/clariondate.sql
Convert a Clarion Date (INT) to SQL DateTime
/*
A Clarion standard date is the number of days that have elapsed since
December 28, 1800. The range of accessible dates is from January 1, 1801
(standard date 4) to December 31, 9999 (standard date 2,994,626). Date
procedures will not return correct values outside the limits of this range.
The standard date calendar also adjusts for each leap year within the range of
accessible dates. Dividing a standard date by modulo 7 gives you the day of the
week: zero = Sunday, one = Monday, etc.
If you are working with the newer DATE type fields (introduced in MSSQL2008)
<?php
function genpass($length = 16) {
$ch = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$string = '';
for ($i = 0; $i <= $length; $i++) {
$string .= $characters[mt_rand(0, strlen($ch)-1)];
}
return $string;
}
?>
---------------------------------------------------------------------
| The CASC (Content Addressable Storage Container) Filesystem |
| Warlords of Draenor Alpha, Build 6.0.1.18125 |
| Written April 14th, 2014 by Caali |
| Version 1.2 |
---------------------------------------------------------------------
Distribution and reproduction of this specification are allowed without
limitation, as long as it is not altered. Quotation in other works is
freely allowed, as long as the source and author of the quote are stated.