Skip to content

Instantly share code, notes, and snippets.

---------------------------------------------------------------------
| 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.
<?php
function genpass($length = 16) {
$ch = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$string = '';
for ($i = 0; $i <= $length; $i++) {
$string .= $characters[mt_rand(0, strlen($ch)-1)];
}
return $string;
}
?>
@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)
@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
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 / 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
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
@Ambalus
Ambalus / install-mongo.sh
Created December 22, 2015 17:00 — forked from vilasmaciel/install-mongo.sh
Install mongodb
#!/bin/sh
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-org
apt-get update
apt-get upgrade
apt-get install python-software-properties
add-apt-repository -y ppa:ondrej/php
add-apt-repository -y ppa:ondrej/apache2
add-apt-repository -y ppa:ondrej/mysql-5.5
apt-get update
apt-get purge php mysql
apt-get install -y apache2 mysql-server-5.5 libapache2-mod-php7.0 php \
php7.0-mysql php7.0-curl php7.0-json php7.0-bz2 php7.0-xml php7.0-ldap
$OtherCleanPathsArr =
"C:\Temp\*",
"C:\Windows\Temp\*"
#системные пути для очистки
$InProfilesCleanPathsArr =
"\AppData\Local\Temp\*",
"\AppData\Local\*.auc",
"\AppData\Local\Microsoft\Terminal Server Client\Cache\*",
"\AppData\Local\Microsoft\Windows\Temporary Internet Files\*",